[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby under Cygwin problems

JZ

7/4/2005 1:49:00 PM

Whatever Ruby module I want to install under Cygwin I always get the same
error: ruby: No such file to load -- ubygems (LoadError)

I've tried install rubygem, rubyfcgi etc. After "ruby config.rb config" or
"ruby config.rb install" I get error: "ruby: No such file to load --
ubygems (LoadError)" It looks strange. I am using last cygwin installation
with ruby 1.8.2 ()ruby 1.8.2 (2004-12-25) [i386-cygwin])

--
JZ
30 Answers

Daniel Brockman

7/5/2005 3:03:00 AM

0

Austin Ziegler

7/5/2005 3:37:00 AM

0

On 7/4/05, Daniel Brockman <daniel@brockman.se> wrote:
> JZ <usenet@zabiello.com> writes:
> > Whatever Ruby module I want to install under Cygwin I always get the
> > same error: ruby: No such file to load -- ubygems (LoadError)
> Sounds like someone is using `-rubygems' instead of `-rrubygems'.
> (Sorry for stating the obvious.)

Except that in a RubyGems installation, there's an ubygems.rb that
simply loads rubygems.rb.

The problem, I suspect, is that JZ has both the cygwin Ruby and the
One-Click Ruby installed. The native Windows Ruby includes RubyGems.
The cygwin Ruby does not.

-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


Lothar Scholz

7/5/2005 7:07:00 AM

0

Hello Daniel,

DB> JZ <usenet@zabiello.com> writes:

>> Whatever Ruby module I want to install under Cygwin I always get the
>> same error: ruby: No such file to load -- ubygems (LoadError)

DB> Sounds like someone is using `-rubygems' instead of `-rrubygems'.
DB> (Sorry for stating the obvious.)

No this is not the problem, it's just one more of this quick and
dirty hacks (that i don't like in ruby). To make it more readable
someone had to the great idea to write a "ubygems.rb" file that
contains only one line "require 'rubygems'". The 'ubygems.rb' is
included by default in the one-click-installer and the rubygems
package.

And setting RUBYOPT by default is IMHO another quick and dirty hack.


--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ru...
CTO Scriptolutions Ruby, PHP, Python IDE 's




Daniel Brockman

7/5/2005 8:49:00 AM

0

JZ

7/5/2005 9:29:00 AM

0

Dnia Tue, 5 Jul 2005 12:37:17 +0900, Austin Ziegler napisa3(a):

> The problem, I suspect, is that JZ has both the cygwin Ruby and the
> One-Click Ruby installed.

Yes, I have. After unseting RUBYOPT variable I can install gem.

--
JZ

karlin.fox@gmail.com

7/5/2005 5:12:00 PM

0

> No this is not the problem, it's just one more of this quick and dirty hacks (that i don't like in ruby).

I agree whole-heartedly that this is a silly hack. In introducing
others to Ruby I've had them complain about how unclear the -r ubygems
thing is. One of my coworkers swore he would never use rubygems
because of this, I had a hard time convincing him otherwise. Cygwin
ruby and the one-click installer should work better together, and
RUBYOPT and ubygems are the first problems to solve towards this goal,
IMHO. I think ubygems critically violates the least-surprise principle!

Ryan Leavengood

7/5/2005 6:24:00 PM

0

karlin.fox@gmail.com said:
>
> I agree whole-heartedly that this is a silly hack. In introducing
> others to Ruby I've had them complain about how unclear the -r ubygems
> thing is. One of my coworkers swore he would never use rubygems
> because of this, I had a hard time convincing him otherwise. Cygwin
> ruby and the one-click installer should work better together, and
> RUBYOPT and ubygems are the first problems to solve towards this goal,
> IMHO. I think ubygems critically violates the least-surprise principle!

I personally haven't noticed any problems with this "hack" as you guys
like to call it, and having seen the issues involved with something like
RubyGems (in doing the original prototype) I think it is the best
solution.

I'd really like to hear alternatives. Keep in mind I'm not a developer on
the current RubyGems, so it's not like I'm defending any work of my own.
But I know the RubyGems developers have put a lot of hard work into it,
and to complain as you have without any suggestions for alternatives isn't
particularly constructive.

The issue is that to use libraries that are packaged as gems, you must
require 'rubygems' first. To do this as a gem user in all your scripts is
a bit of a pain, and should you want to distribute your scripts you run
into issues of people possibly not having RubyGems installed. So then
maybe you change that line to "require 'rubygems' rescue nil", which I
think is a bit worse of a hack than the RUBYOPT "hack."

Maybe a nice option would be for the One-Click Installer to prompt on
whether the user wants RUBYOPT set up with "rubygems" or not, with an
explanation of what it is for, and what it means (including what ubygems
is.) That should be the best of both worlds, eh?

Ryan


Curt Hibbs

7/5/2005 7:02:00 PM

0

Ryan Leavengood wrote:
>
> Maybe a nice option would be for the One-Click Installer to prompt on
> whether the user wants RUBYOPT set up with "rubygems" or not, with an
> explanation of what it is for, and what it means (including what ubygems
> is.) That should be the best of both worlds, eh?

You can tell the One-Click Installer not to prepend "rubygems" to the
RUBYOPT environment variable.

When you get to the "Choose Components" screen, the component "RubyGems
Package Manager" can be unchecked to completely omit RubyGems or,
alternatively, You can click on the plus to expand the subitems and just
uncheck "Enable RubyGems" (this will still install RubyGems but not set
RUBYOPT).

Curt


Ryan Leavengood

7/5/2005 9:50:00 PM

0

Curt Hibbs said:
>
> You can tell the One-Click Installer not to prepend "rubygems" to the
> RUBYOPT environment variable.
>
> When you get to the "Choose Components" screen, the component "RubyGems
> Package Manager" can be unchecked to completely omit RubyGems or,
> alternatively, You can click on the plus to expand the subitems and just
> uncheck "Enable RubyGems" (this will still install RubyGems but not set
> RUBYOPT).

Cool. Then I guess the main problem is most people are not aware of this,
and they get bit by it being on by default. Again, I think this is fine,
but maybe this option needs to be made more explicit for those who don't
want it.

Ryan


soxinbox

7/6/2005 12:42:00 AM

0

I ran into this problem at work. I was trying to do some ruby programs to
help automate some version control stuff. I tried to convince people how
easy Ruby is, but then when I spent a few hours tracking this problem down,
I couldn't really argue that I wasn't going to run into more problems down
the road. With each gotcha, I lost more support. We now use perl for all of
our stuff. It is OK for a ruby programmer to have to deal with these
annoying issues at each major release, but these problems also effect the
end users who are not ruby programmers and not computer savvy.

I know that a lot of work and good code goes into these projects on a
volunteer basis, so I don't want to disparage the great effort, but, in my
opinion, this work would shine that much brighter if there was just a small
amount of effort put into ensuring that beginner users did not run into
basic problems during new releases and installs. Just ensuring that new
installs work on a minimum of platforms like Linux, windows, and cygwin,
would go a long way.

Imagine when someone makes the big step to try using ruby for the first
time. They install with the one click editor, use the included Scite editor,
and try one of the basic sample programs in the IRB window. They immediately
notice that every character they type shows up twice in the window.
Realizing that that isn't working they try to cut and past a small program
from the editor window to the irb window, and irb gets all confused with the
carriage returns. If they are not completely discouraged by this point they
might try to run an existing program in a cygwin shell, and get the ubygems
error. That is about as far as anyone will go in trying something new, and
we have just lost another ruby convert.

"Ryan Leavengood" <mrcode@netrox.net> wrote in message
news:44059.206.157.248.34.1120600225.squirrel@www.netrox.net...
Curt Hibbs said:
>
> You can tell the One-Click Installer not to prepend "rubygems" to the
> RUBYOPT environment variable.
>
> When you get to the "Choose Components" screen, the component "RubyGems
> Package Manager" can be unchecked to completely omit RubyGems or,
> alternatively, You can click on the plus to expand the subitems and just
> uncheck "Enable RubyGems" (this will still install RubyGems but not set
> RUBYOPT).

Cool. Then I guess the main problem is most people are not aware of this,
and they get bit by it being on by default. Again, I think this is fine,
but maybe this option needs to be made more explicit for those who don't
want it.

Ryan