BARRIER - require "rubygems"

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

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)?

.

On 9 June 2011 20:15, Ilias L. [email protected] wrote:

Because it’s included, I expect that it will work out-of-the-box,
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.

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.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/9/2011 1:15 PM, Ilias L. wrote:

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-----

Ilias L. wrote in post #1004225:

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\Jon\Documents\RubyDev\sandbox>ver

Microsoft Windows [Version 6.1.7601]

C:\Users\Jon\Documents\RubyDev\sandbox>ruby --version
ruby 1.9.3dev (2011-06-10 trunk 31977) [i386-mingw32]

C:\Users\Jon\Documents\RubyDev\sandbox>type rg_present.rb
puts Module.constants.include?(:Gem)
puts Gem::VERSION

C:\Users\Jon\Documents\RubyDev\sandbox>ruby rg_present.rb
true
1.8.5

On Jun 10, 11:40am, Ilias L. [email protected] wrote:

work.

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”.

On 10 , 19:33, Luis L. [email protected] wrote:

irb(main):002:0>
installer", I had to use "require ‘rubygems’ " in order to make it
work.

There is no such thing as One-Click Installer, is RubyInstaller

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

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.

.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/10/2011 10:35 AM, Luis L. 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-----

On 9 , 22:35, Walton H. [email protected] wrote:

without the need to use

C:\Users\walton.hoops\repos>ruby --version
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

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

.

On 11 , 06:35, Luis L. [email protected] wrote:

On Jun 10, 1:05pm, Ilias L. [email protected] wrote:

I see, possibly this should be enabled by default (a knowledgeable
user will take action and disable if he needs so)

Defaults like file associations and editors are very subjective.
[…] - (expanding issue, getting personal)

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”.

.

On Jun 11, 7:06am, Ilias L. [email protected] wrote:

(…) (some babbling about getting personal)

The fundamental user expectation is that it works out-of-the-box,
without any intervention.

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.

On Jun 10, 1:05pm, Ilias L. [email protected] wrote:

I see, possibly this should be enabled by default (a knowledgeable
user will take action and disable if he needs so)

Defaults like file associations and editors are very subjective.

This is how RubyInstaller stand about that:

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.

On 11/06/2011 17:30, Ilias L. wrote:

On 11 , 17:40, Luis L. [email protected] wrote:
[…] - (ha! )

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).

.

2011/6/11 Ilias L. [email protected]:

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).

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: Microsoft Learn: Build skills that open doors in your career


Phillip G.

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

On 11 , 20:30, Phillip G. [email protected]
wrote:

them to opt in instead. For example, users should explicitly choose to
install a Windows Desktop Gadget."

Source:Microsoft Learn: Build skills that open doors in your career

This subjects “optional features”.

The basic requirement I’ve mentioned subjects “necessary setup actions
to make product operative”.

.

http://lazaridis.com

On 11 Ιούν, 20:15, Matt H. [email protected] wrote:

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.

I hope you feel better now.

.

2011/6/11 Ilias L. [email protected]:

This subjects “optional features”.

The basic requirement I’ve mentioned subjects “necessary setup actions
to make product operative”.

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.


Phillip G.

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

Ilias L. wrote in post #1004725:

On 11 , 20:30, Phillip G. [email protected]
wrote:

them to opt in instead. For example, users should explicitly choose to
install a Windows Desktop Gadget."

Source:Microsoft Learn: Build skills that open doors in your career

This subjects “optional features”.

The basic requirement I’ve mentioned subjects “necessary setup actions
to make product operative”.

Wrong.

Against my better judgement I’m replying so that any newcomers who may
be considering using Ruby on Windows from the RubyInstaller understand
the issue better.

Putting a specific Ruby version on PATH and associating that same Ruby
version to .rb/.rbw files is not “necessary setup actions to make
product operative.” The installed Ruby works just fine without taking
these steps.

The reason we do not force these actions on a user by default is the
simple fact that a user may have a particular setup that would be
clobbered by us incorrectly assuming that the installer should always
add the Ruby to PATH and always associate that specific Ruby with
.rb/.rbw files.

Think through the usage cases of multiple installed Rubies and other
customizations that may already exist on a system. You might also want
to check out how the Python installer works.

Bottom line…users know much better how their system configured than
we ever will. As such, we focus on providing sensible defaults and
user-selectable options in a quick and (hopefully) easy to use
RubyInstaller.

Jon

2011/6/11 Ilias L. [email protected]:

On 11 Ιούν, 20:30, Phillip G. [email protected]
wrote:

The basic requirement I’ve mentioned subjects “necessary setup actions
to make product operative”.

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.

On Sun, Jun 12, 2011 at 03:01:17AM +0900, Phillip G. wrote:

will work without those.
More to the point, you can use libraries without rubygems.