Topic: Rails problems on Debian, I think it might be a gem problem

I'm trying to convince people I work with how great RoR is, and the first time someone tries to install it everything goes to hell sad

Anyways, she has a Debian machine, and the output of `uname -a` is:

Linux metascholar3 2.6.3-1-386 #2 Tue Feb 24 20:20:23 EST 2004 i686 GNU/Linux

Ruby is version 1.8.4

When I tried to install gem (ie. "ruby setup.rb"), I got the following error at the end:

Removing old RubyGems RDoc and ri...
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /home/ugadi/gem_install/rubygems-0.9.2/./post-install.rb:103:in `install_rdoc'
        from /home/ugadi/gem_install/rubygems-0.9.2/./post-install.rb:118:in `try_run_hook'
        from setup.rb:584:in `run_hook'
        from setup.rb:1322:in `exec_task_traverse'
        from setup.rb:1175:in `exec_install'
        from setup.rb:894:in `exec_install'
        from setup.rb:717:in `invoke'
        from setup.rb:681:in `invoke'
        from setup.rb:1359

I thought I was able to bypass this problem, because I was able to actually call gem.  I used gem to install Rails 1.2.1 and everything seemed fine...

until she tried to actually run a Rails app.  When I started WEBrick and tried to call an action on a controller, I got a 404 Not Found error in the browser.  There was an ArgumentError (I don't have the full text, I'll post it tomorrow) in the console.

Anyone have any ideas?  How can I uninstall all of rails (including all the dependencies) and then reinstall it all?

If there is a post/website/blog entry/whatever that answers my questions, please don't hesitate to simply post a link.  I know it can get old fast to answer the same question hundreds of times...

Re: Rails problems on Debian, I think it might be a gem problem

If you find all your gem and rails related files and delete them (probably somewhere around /usr/lib/ruby or /usr/local/ruby) and then reinstall via apt-get you should be fine.

apt-get install ruby
apt-get install rubygems
gem install rails --include-dependencies

Re: Rails problems on Debian, I think it might be a gem problem

Ok, thanks.

If there is a post/website/blog entry/whatever that answers my questions, please don't hesitate to simply post a link.  I know it can get old fast to answer the same question hundreds of times...

Re: Rails problems on Debian, I think it might be a gem problem

I uninstalled everything, then reinstalled gem using apt-get, and this is the error I get every time I try to run gem:

/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- sources (LoadError)

I can post the entire stack trace if it's useful.

If there is a post/website/blog entry/whatever that answers my questions, please don't hesitate to simply post a link.  I know it can get old fast to answer the same question hundreds of times...

Re: Rails problems on Debian, I think it might be a gem problem

I have tried uninstalling (using apt-get remove) for ruby and rubygems.  This seemed to work.

When I reinstalled, everything worked fine (according to apt-get).

However, when I run gem, I get the following:

/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- sources (LoadError)
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/site_ruby/1.8/rubygems/source_info_cache.rb:6
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/site_ruby/1.8/rubygems/remote_installer.rb:12
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:112:in `manage_gems'
        from /usr/bin/gem:10

Anyone have any ideas??

If there is a post/website/blog entry/whatever that answers my questions, please don't hesitate to simply post a link.  I know it can get old fast to answer the same question hundreds of times...

Re: Rails problems on Debian, I think it might be a gem problem

I'm using Debian (etch) to install and run all this stuff without any problems. One thing you could still try is using aptitude instead of apt-get (aptitude installs dependencies and stuff automatically.)

Another thing that might help is, after you remove all of the offending packages, running these commands in order:

aptitude clean
aptitude autoclean
aptitude update
aptitude upgrade

and then reinstall again like Danger said.

This should make sure any old cruft is cleaned from your system and you're using the latest versions of everything and everything that depends on it.

Dunno if it'll help but it's a start..

Re: Rails problems on Debian, I think it might be a gem problem

Our local Linux guru finally fixed it for us.  I don't know what he did, but it worked.

Sorry I can't be more descriptive sad

Thanks for all the helpful suggestions.

If there is a post/website/blog entry/whatever that answers my questions, please don't hesitate to simply post a link.  I know it can get old fast to answer the same question hundreds of times...

Re: Rails problems on Debian, I think it might be a gem problem

Micah wrote:

Our local Linux guru finally fixed it for us.  I don't know what he did, but it worked.

Sorry I can't be more descriptive sad

Thanks for all the helpful suggestions.

Hi Micah,

Would it be too much to ask if you could find out from your Linux Guru what he did and post the info here? It would help me a great deal as i am having the same problem.

TIA,

bakki

Re: Rails problems on Debian, I think it might be a gem problem

I've found a solution to this.
Basically, it was reinstalling the gem command.
Reinstalling the rubygems package didn't do the trick, the package to reinstall was libgems-ruby1.8 .

Basically you should do:

sudo apt-get install --reinstall libgems-ruby1.8

Also,
sudo dpkg-reconfigure libgems-ruby1.8

may be sufficient, but I didn't try that.

Last edited by Tobu (2007-03-08 13:51:47)

Re: Rails problems on Debian, I think it might be a gem problem

I am still having a problem after reinstalling all ruby related debs and reinstalling libgems.
gem install rails etc works fine and puts all the gems at /var/lib/gems. However if I do as a regular user
rails test

I get bash: rails: command not found.

If do a
require 'rails' from inside irb I get:
LoadError: no such file to load -- rails
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from (irb):1
So rubygems is not setting up the paths correctly? I'll keep digging and hopefully will find an answer. Meanwhile if any one has any ideas I'd love to hear about them.

THanks,

bakki

Re: Rails problems on Debian, I think it might be a gem problem

Hello there, I got the same problem on MEPIS 6.0, which is a derivative of Debian. I figured that it had something to do with rdoc?!?

# whoami
root
# apt-get install rdoc
# pwd
/root/Desktop/rubygems-0.9.2
# ruby setup.rb

I also checked out the rubygems website for some Debian-specific help:

http://rubygems.org/read/chapter/3

# apt-get install libyaml-ruby
# apt-get install libzlib-ruby
# gem install rails

I figure there must be more to it than just rails (e.g. activerecord) but that's enough work for the night.

Hope this has been useful.

Re: Rails problems on Debian, I think it might be a gem problem

sudo apt-get install rdoc

this fixed the following for me:

/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- rdoc/rdoc (LoadError)
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:71:in `load_rdoc'
        from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:41:in `generate_ri'
        from /usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:112:in `execute'
        from /usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:111:in `execute'
        from /usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:49:in `execute'
        from /usr/local/lib/site_ruby/1.8/rubygems/command.rb:70:in `invoke'
        from /usr/local/lib/site_ruby/1.8/rubygems/command_manager.rb:120:in `process_args'
        from /usr/local/lib/site_ruby/1.8/rubygems/command_manager.rb:91:in `run'
        from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:30:in `run'
        from /usr/bin/gem:23

Last edited by aglet (2007-05-14 12:42:22)

Re: Rails problems on Debian, I think it might be a gem problem

Hi, I had the same issue using Debian (etch) but found that it was because I had to:

$ sudo apt-get install libfcgi-ruby1.8

Hope this helps..

Last edited by snapfrozen (2007-05-22 23:16:28)