Rubygems is included in ruby 1.9.
Because it's included, I expect that it will work out-of-the-box,
without the need to use
ruby -rubygems myscript.rb
and especially not
require "rubygems"
within *.rb files
-
The default-library-system which is included in the language, should
be *enabled* by default, thus a user can simply click on the files and
they start correctly, without the (logically false) need to have
"require librarysystem" within the files.
What step do I have to take, in order to activate rubygems as the
default library system (thus I can start .rb files without having to
require rubygems)?
.
Or you could try using the well documented RUBYOPT shell variable to
set the value RUBYOPT=rubygems
The only barrier here is that you didn't read the rubygems user guide
which is available on the internet. It even explains how to do this on
windows if you should be do hampered.
On 6/9/2011 1:15 PM, Ilias Lazaridis wrote:
> ruby 1.9.2p180 Windows 7
>
> Rubygems is included in ruby 1.9.
>
> Because it's included, I expect that it will work out-of-the-box,
> without the need to use
>
> ruby -rubygems myscript.rb
>
> and especially not
>
> require "rubygems"
>
> within *.rb files
>
> -
C:\Users\walton.hoops\repos>ruby --version
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
C:\Users\walton.hoops\repos>irb
irb(main):001:0> require 'sinatra'
=> true
irb(main):002:0>
Works for me. Does it not for you? If not can you give us some more
information, such as a simple demo that reproduces the issue?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJN8SAWAAoJELvwGgGC0Isy0icIAJAXWanWpPKwfpwzeYw+j5vG
/80kMMQOZc2MAxHAEy+OnPVw8rzkvxx2uiw9eHcIeLkLUNUAp7ABGO9AkudWItvW
+CZUBxBeRNov6UhNY2+wKdJU3TpyMd+6OdjEidCnyEpqrks6f0kSPr7gefXtHc2X
UFfQLuSJuMjUNim6vI9lPv6Q+FIectpNTTzE+N6tAk5pxU4VwXjBVBUpmRG6s/iN
7BesAMavuDeEaCrODPu7axUgGhkv+St6q9OdXWlRFZZdwYkt78m+aaMiO0Qha15K
pmUfubOtPf6SVOLRtBCoDhfsf5XXrRptvMl0IbaTBWNh/tk8MhMHVGmciCu6oh8=
=4B/T
-----END PGP SIGNATURE-----
same version here.
> C:\Users\walton.hoops\repos>irb
> irb(main):001:0> require 'sinatra'
> => true
> irb(main):002:0>
>
> Works for me.
> Does it not for you?
It works.
And in my file, I've removed "require 'rubygems' " now, and it works,
too (to my surprise).
But I'm sure it did not. After I installed via the "one-click-
installer", I had to use "require 'rubygems' " in order to make it
work.
I've now uninstalled everything including the gems, and reinstalled:
It works again.
I can't recreate it on this machine anymore.
> If not can you give us some more
> information, such as a simple demo that reproduces the issue?
It was really not much more than:
require 'rubygems' #add this, thus files can be started with double-
click on windows-explorer
require 'sinatra'
require 'json'
#some code to test rest & json
.
There is no such thing as One-Click Installer, is RubyInstaller
Ruby 1.9.1 and 1.9.2 remove the need for require "rubygems"
If you can't replicate it, then it didn't happen.
> I've now uninstalled everything including the gems, and reinstalled:
>
> It works again.
>
> I can't recreate it on this machine anymore.
>
Has nothing to do with your machine, it works since long time ago, we
worked really hard to ensure that was for everybody.
> > If not can you give us some more
> > information, such as a simple demo that reproduces the issue?
>
> It was really not much more than:
>
> require 'rubygems' #add this, thus files can be started with double-
> click on windows-explorer
Please note that you mentioned "One-Click Installer" but also
mentioned 1.9.2
RubyInstaller do not associate with .rb and .rbw files by default, you
need to check these options.
If you had a previous "One-Click Installer" (1.8.6 or older) and that
was associated with .rb files, that could explain why you needed
require "rubygems".
--
Luis Lavena
Confirmed, RubyInstaller
> Ruby 1.9.1 and 1.9.2 remove the need for require "rubygems"
ok
> If you can't replicate it, then it didn't happen.
It happened, just don't know the cause.
> > I've now uninstalled everything including the gems, and reinstalled:
>
> > It works again.
>
> > I can't recreate it on this machine anymore.
>
> Has nothing to do with your machine, it works since long time ago, we
> worked really hard to ensure that was for everybody.
ok
> > > If not can you give us some more
> > > information, such as a simple demo that reproduces the issue?
>
> > It was really not much more than:
>
> > require 'rubygems' #add this, thus files can be started with double-
> > click on windows-explorer
>
> Please note that you mentioned "One-Click Installer" but also
> mentioned 1.9.2
>
> RubyInstaller do not associate with .rb and .rbw files by default, you
> need to check these options.
I see, possibly this should be enabled by default (a knowledgeable
user will take action and disable if he needs so)
> If you had a previous "One-Click Installer" (1.8.6 or older) and that
> was associated with .rb files, that could explain why you needed
> require "rubygems".
There is a possibility that this was the case.
One other possible influence could be the Kommodo IDE.
Anyway, if you say that this is a solved issue, than I consider it
closed.
btw:
Thank you for this RubyInstaller, makes things very easy.
.
On 6/10/2011 10:35 AM, Luis Lavena wrote:
> Please note that you mentioned "One-Click Installer" but also
> mentioned 1.9.2
>
> RubyInstaller do not associate with .rb and .rbw files by default, you
> need to check these options.
>
> If you had a previous "One-Click Installer" (1.8.6 or older) and that
> was associated with .rb files, that could explain why you needed
> require "rubygems".
That would be my guess as well. If you installed 1.8.6 from the (now
discontinued) one click installer, and later installed 1.9.2 via Ruby
Installer, by default it didn't associate the *.rb files with the new
installation, so when you ran from the command line you were using 1.9.2
as intended, but double clicking the file ran it on 1.8.6.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJN8lExAAoJELvwGgGC0IsyCywH/37DoakVro2Yd2msF6b2a2L1
a+tnnPVcNXemV74gtwo9uVlPfLJ8mUNdopgfYLg+kdIBC6xpxcIUYy/iCb/wm+C+
Qn8zaC+R7RGmVCw/9Pw5tYJ4E/GXPCb/jdnW0NORMrDqUHeoai8cXfI8HY9wPK8F
N5RwVCY+eWboH1DnJ6GFIm5ECZg565gjBEuz2APH1bVuOc9sUW74I8ynWx1G0Jha
L46c9FEfFCmJy5muknZ+Hcs08newoYUAIELt/4W2yRtxtRxrAfUFfXBdtJ/5POdk
dseOEm/Q3o6p2SePjkAuQb59g2/5ZtLGfVZ1daIH6bBevaUiGeR4YGen7gVf7o8=
=E18s
-----END PGP SIGNATURE-----
Defaults like file associations and editors are very subjective.
This is how RubyInstaller stand about that:
https://github.com/oneclick/rubyinstaller/wiki/FAQ#bundled_scite
http://groups.google.com/group/rubyinstaller/msg/34dd829ebe0e4567
Want it different, build your installer and name it IlliasInstaller.
Something more constructive than that is what RailsInstaller project
did.
--
Luis Lavena
No need to get personal or to extend the issue, it's very simple:
The fundamental user expectation is that it works out-of-the-box,
without any intervention.
And this is the major requirement to an installer.
Usually there is a choice, something like:
[X] Default Installation
[ ] Custom Installation
"Default Installation" does not mean "I don't touch anything".
It means "I take the necessary actions to make the product running on
this machine".
If a user wants to have more control over the installation, he selects
"Custom installation".
.
Oh, you mean magical, like an automated install? Or probably you mean
unattended installation, that is when there is no user intervention.
The fundamentals are: when I install something, I don't want it mess
with my existing stuff.
If you actually install stuff on Windows, you will know how counter
productive is when you install something to try out and it changes all
your defaults.
> Usually there is a choice, something like:
> (...) (babbling and giving unsolicited advice on UX and installers)
What this does is hide the actions in two obscure items that newcomers
will not know what it means. Default installation doesn't say
anything, Neither does custom.
Right now the installers show in one single screen all your options,
which if users actually READ will be able to get what they want from
the installation.
--
Luis Lavena
You have to increase your precision in order to mimic my writing
style.
Back to topic: please ask some product manager that you trust about
the basic installer requirement that I've mentioned (it's not my
requirement, but a general one).
.
Maybe if you took the time out of being a thoroughly abrasive
individual, you would have actually read the rubyinstall web page and
found the link to request a bug/feature. Developers are not at your beck
and call.
Here is a quote from Microsoft's UX design guidelines:
"Don't force users to opt out of installing optional features. Allow
them to opt in instead. For example, users should explicitly choose to
install a Windows Desktop Gadget."
Source: http://msdn.microsoft.com/en-us/library/ee915058.aspx
--
Phillip Gawlowski
A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibnitz
This subjects "optional features".
The basic requirement I've mentioned subjects "necessary setup actions
to make product operative".
.
I hope you feel better now.
.
So, the RubyInstaller doesn't actually install Ruby and its
dependencies? That's *all* that a setup package is required to do.
File association and path changing are very much optional, since Ruby
will work without those.
Ruby is operative without file associations to .rb/.rbw files. While
setting file associations is a sensible default for lots of software,
the usual use case of RubyInstaller is such that it is not clearly one
of the cases where file associations by default make sense; so the
safer choice is to minimize disruption by not setting them.
Verification:
* Install with the defaults (just "click through")
* Go to the command line, and start ruby (type "ruby" then [ENTER]
* Go to the explorer and create this file "test.rb" with content "puts
'hi'", double click this file
Both will not work.
.
http://tvtropes.org/pmwiki/pmwiki.php/Main/CaptainObvious
Of course it's obvious, and as an (obvious) conclusion you previous
statement becomes false.
"File association and path changing are very much optional, since
Ruby
will work without those. "
But what becomes even more obvious is, that I'm loosing my time with
you.
I'm sure that the relevant people will realize that in context
"newcomer", both options should be enabled by default.
Topic closed.
.
http://msdn.microsoft.com/en-us/library/ee915058.aspx
"Another reason to streamline setup is that inexperienced users
sometimes overanalyze options, fearing that a wrong choice could be
irreversible or destructive. Forcing users to make decisions about
things they don't understand or care about can make them feel anxious,
incompetent, and even frustrated. Not a good first impression. It is
better just to get them going quickly, feeling comfortable and
confident as they explore the features in your program, and making
better decisions about feature options at that time."
Standard Setup, Custom Setup, that is adding too much noise. Also, an
standard setup should not alter the user environment.
RubyInstaller provides an access to the command prompt, "Start Command
Prompt with Ruby", which is located inside the Program menu, the place
newcomers will check as soon the installed something.
If you're savvy enough to attempt to use the default command prompt
that means you know about "Add Ruby to your PATH" option, which you
should have checked.
"Scope pages (typical, custom, or minimum)
Prefer to eliminate this page. Assume that most users want the typical
setup experience (and design that experience so that it works well for
most users)."
---
Anyhow, seem your level of expertise in fields from OO, embedded
system, consulting, UX and UI is so huge, perhaps you can support your
words with code.
Yeah, code, that thing that make things work.
Here is RubyInstaller repository:
http://github.com/oneclick/rubyinstaller
Bet you something: if you contribute "something" instead of continuous
non-constructive criticism, I'll happily apply to the project. After
all, we all will benefit.
To the above statement you will argue that you have nothing to prove
me, which will result in prove my point: your complete lack of
technical skills.
So, I challenge you for once and for all *do* something instead of
flood with criticism. Change start on you.
Until then, bye.
--
Luis Lavena
Ruby working is contingent neither on double-clicking nor on being in the
system path. For this to be false, you would have to demonstrate that actually
launching Ruby via a full path on the commandline does not work. I don't have
a Windows machine, but I assume that
C:\path\to\rubyw.exe myscript.rb
does, in fact, work. I imagine you could also create batch files, or even
plain Windows shortcuts, which launch Ruby scripts.
> I'm sure that the relevant people will realize that in context
> "newcomer", both options should be enabled by default.
If a "newcomer" is blindly installing software without reading and
understanding options like these, perhaps programming isn't likely to be a
strong suit for them?
> Topic closed.
That's not up to you.
This just confirms: leave the boxes checked, or get rid of them (maybe
detect if there are already associations or path variables, and
confront the user only then).
> Anyhow, seem your level of expertise in fields from OO, embedded
[...]
What you call "criticism" is basically detecting issues like
weaknesses, flaws, barriers, inconsistencies, defects.
This is my main expertise, or an inborn talent and tendency (or even a
"curse").
If spotting the issues leads to change, then this is a constructive
criticism, a contribution.
If I make additionally implementation / architectural suggestions,
then it's design work.
If there is much change-resistance (e.g. from the typical "freak-
show", the self-declared "community police" or simply by one crazy-
gone individual who writes publicly when he's under drugs), then it
becomes hard work.
Each issue needs an (estimated) average of 2 days mental attention
until it is solved in the language repository (where it benefits all).
Saying that this is no contribution at all is simply ungrateful and
insincere.
> Here is RubyInstaller repository:
> http://github.com/oneclick/rubyinstaller
I don't have to prove my technical skills. The people that I'm
interested in, detect my abilities just from my writings - they don't
need to see a line of code.
But I'll reach code-level "naturally".
I'll most possibly try the DevKit when I reach C-level. I'll report as
usual issues that I spot and most possibly I'll send some code-level
changes via the usual channels.
.
Of course it is.
Dismissed!
.
Would you hire someone without seeing a line of code from them?
http://thedailywtf.com/Articles/The_Abstract_Candidate.aspx
Of course, you don't have to do anything at all, a priori. You can go right on
making suggestions, demands, and "detecting issues" without providing code,
and we can go right on assuming you're an Abstract Candidate until you
demonstrate otherwise.
Topic closed.
Dismissed!
.
please note that several messages which appear on ruby-talk
http://www.ruby-forum.com/topic/1893359
Posted by Jon Forums (jonm) on 2011-06-09 23:34
Posted by Jon Forums (jonm) on 2011-06-11 20:36
Posted by Chad Perrin (Guest) on 2011-06-11 21:40
Posted by Aaron Patterson (Guest) on 2011-06-12 23:03
did not arrive within comp.lang.ruby.
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/5cdb05f06f4888ba#
This does not mean necessarily that I ignore you.
I just post & reply only via usenet.
.
> I'm sure that the relevant people will realize that in context
> "newcomer", both options should be enabled by default.
Who are the relevant people? Luis Lavena, who is the RubyInstaller
maintainer, seems to be the most relevant person possible, and clearly
disagrees with you (and note that the position taken by RubyInstaller
was a considered change from the One-Click Installer.)