4

I have successfully installed ruby1.9.1 but after downloading the .tgz archive offered here and doing

sudo ruby1.9.1 setup.rb

I get this:

/home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems/source_index.rb:62:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems/source_index.rb:52:in `from_installed_gems'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems.rb:914:in `source_index'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems/gem_path_searcher.rb:98:in `init_gemspecs'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems/gem_path_searcher.rb:13:in `initialize'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems.rb:873:in `new'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems.rb:873:in `searcher'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems.rb:495:in `find_files'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems.rb:1034:in `load_plugins'
from /home/elliot/Downloads/rubygems-1.4.1 (2)/lib/rubygems/gem_runner.rb:84:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from setup.rb:25:in `<main>'

Why is installing RubyGems with Ruby1.9.1 so painful? How can I install it correctly? Thanks in advance, ell.

Jorge Castro
  • 73,717
ell
  • 302

3 Answers3

1

Just like with python (and Java) if you use the default installation on a Debian based system you will get massive problems. Every language seems to want to make a big deal about having an automated system for installation, instead of working with existing systems.

The real solution is to install ruby and rubygems via apt and if the packages don't exist then you create the packages and host them in a ppa for others to install.

0

$ sudo apt-get install ruby1.9.1 gem1.9.1

personally I suggest ruby 1.9.2p94 or above since 1.9.2p0 has socket library bugs.

Note $ sudo apt-get install ruby1.9.2 gem1.9.2 installs a binary ruby1.9.1 however when you run ruby1.9.1 -v it tells you ruby 1.9.2. I filed a bug with ubuntu and they closed it saying they don't care.

0

If you're interested in using the latest versions of Ruby (I'd suggest using 1.9.2 as it's the latest stable version), then the best way I've seen of achieving this is to use rvm.