BARRIER - require "rubygems"

  • Thread starter Ilias Lazaridis
  • Start date
I

Ilias Lazaridis

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

..
 
P

Peter Hickman

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

Walton Hoops

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

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

Ilias Lazaridis

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

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]

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

..
 
L

Luis Lavena

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.

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.
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".
 
I

Ilias Lazaridis

C:\Users\walton.hoops\repos>ruby --version
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
same version here.
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.

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.
Has nothing to do with your machine, it works since long time ago, we
worked really hard to ensure that was for everybody.
ok




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.

..
 
W

Walton Hoops

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

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

Luis Lavena

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:

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

Ilias Lazaridis

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

..
 
L

Luis Lavena

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

Ilias Lazaridis

[...] - (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).

..
 
M

Matt Harrison

[...] - (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).

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

Phillip Gawlowski

2011/6/11 Ilias Lazaridis said:
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: http://msdn.microsoft.com/en-us/library/ee915058.aspx

--=20
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.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Leibnitz
 
I

Ilias Lazaridis

2011/6/11 Ilias Lazaridis <[email protected]>:




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

This subjects "optional features".

The basic requirement I've mentioned subjects "necessary setup actions
to make product operative".

..

http://lazaridis.com
 
I

Ilias Lazaridis

[...] - (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).

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.

..
 
P

Phillip Gawlowski

2011/6/11 Ilias Lazaridis said:
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.

--=20
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.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Leibnitz
 
C

Christopher Dicely

2011/6/11 Ilias Lazaridis said:
On 11 =CE=99=CE=BF=CF=8D=CE=BD, 20:30, Phillip Gawlowski <cmdjackr...@goo= glemail.com>
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.
 
I

Ilias Lazaridis

This subjects "optional features".

The basic requirement I've mentioned subjects "necessary setup actions
to make product operative".

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.

..
 
I

Ilias Lazaridis


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.

..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top