Alle Wednesday 23 January 2008, unbewusst ha scritto:
i've installed rubygems 0.9.5 with ruby 1.9 lying in my HOME but i get
only a gems/1.8/ directory.
then i think i didn't use to correct version of rubygems ? is that
right ?
what is the best way to get rubygems working with ruby 1.9 installed
in HOME ???
i'm running over Mac OS X 10.4.11
apart from apple's ruby i do have also a ruby "MacPort" under /opt...
Yvon
I installed ruby 1.9 alongside ruby 1.8 on my linux system without any
trouble. I don't know Mac OS X, but I heard is Unix based, so I think you can
use the steps I took, at least as a starting point.
Ruby 1.8 and rubygems were installed using my OS package manager, under the
/usr directory. So I had:
/usr/bin/ruby18
/usr/bin/ruby (a symlink to /usr/bin/ruby18)
/usr/bin/gem18
/usr/bin/gem (a symlink to /usr/bin/gem18)
/usr/lib/ruby/1.8
/usr/lib/ruby/gems/1.8
I decided to install ruby 1.9 in the /usr/local directory. You can choose any
other directory, of course, but you should make sure that it has a bin
subdirectory which is in you PATH. Moreover, I decided to install it using
appending the '19' suffix to the name of the programs, so that I could call
ruby 1.8 (which should remain the default one) with ruby and the new one with
ruby19.
After downloading and extracting the ruby-1.9 tarball, I issued the following
commands:
cd ruby-1.9.0-0
/configure --prefix=/usr/local --program-suffix=19
make
sudo make install
With this, the following files and directories (among others) were created:
/usr/local/bin/ruby19
/usr/local/bin/irb19
...
/usr/local/lib/ruby/1.9
I then downloaded the tgz package (version 1.0.1) from the rubygems rubyforge
page (
http://rubyforge.org/frs/?group_id=126&release_id=17305), extracted it
and did:
cd rubygems-1.0.1
sudo ruby19 setup.rb
It's important to notice I had to use ruby19 to install rubygems, not ruby.
This installed the rubygems .rb files in /usr/local/lib/ruby/site_ruby/1.9.0
and created the file /usr/local/bin/gem19.
To check that everything worked, I tried installing the rake gem:
sudo gem19 install rake
(again note, I called the 1.9 version of gem)
This created the directory /usr/local/lib/ruby/gems/1.9.0 and installed rake
under it.
I hope this helps
Stefano