[Rubygems-developers] error when irb not installed

Eric Hodel drbrain at segment7.net
Wed Dec 27 17:40:47 EST 2006

On Dec 27, 2006, at 05:08, Jim Freeze wrote:
> On Dec 27, 2006, at 1:38 AM, Eric Hodel wrote:
>> On Dec 26, 2006, at 21:20, Jim Freeze wrote:
>>> Should I be getting an error when installing a gem on
>>> a machine that irb is not installed on?
>> Yes.  Rubygems requires all of ruby to be installed.
> Maybe it should more gracefully fail. I was using CentOS at the
> time, and had installed ruby with 'yum install ruby'. It is an  
> additional
> install 'yum install irb' to get irb. :(

Ruby's `make install` installs everything.  There is no make target  
(or other built-in command) that will only install this standard  
library file or that standard library file for ruby.

Adding hacky code to detect a hacky ruby install isn't maintainable.   
Today irb is missing, but tomorrow it might be that they've cut out  
thread.rb or OpenURI or ...

RubyGems is set up by default to give you RDoc and ri data that you  
can use right away.  Its fairly common knowledge that gem_server  
allows you to look at the RDoc for all of your gems.  Attempting to  
degrade gracefully is going to confuse users.

Instead of saying:

"since you installed ruby from the ABC distribution you need to first  
install X, Y, and Z, then run `gem rdoc` for all your gems."

and maintaining a table of distributions and commands necessary to  
install all of ruby and hacks to figure out what to do if some part  
of the standard library is missing.

We can say:

"irb is part of ruby.  If you don't have irb with your ruby it is  
broken.  Figure out how to install irb for ABC distribution then  
RubyGems will work.  Be sure to file a bug with your distribution for  
shipping a broken ruby, too."

and leave things as they are.

The error you got is pretty clear:

No such file to load -- irb/slex (LoadError)

I would file a bug with CentOS.  My /usr/local/lib/ruby/1.8 is all of  
6.7M, so installing the standard library as it ships is not onerous.

Eric Hodel - drbrain at segment7.net - http://blog.segment7.net


More information about the Rubygems-developers mailing list