On Mac OS X 10.4.8, Ruby 1.8.2 is installed in /usr/bin/ruby
I installed RubyGems and several libraries.
I needed to upgrade to the latest version,
so I downloaded Ruby 1.8.5 source from: http://www2.ruby-lang.org/en/20020102.html
which I installed in:
/usr/local/bin/rub
Now RubyGems and the libraries I had installed are not found.
I can run ruby with this alias:
ruby='/usr/local/bin/ruby'
Is there a way to get RubyGems and the libraries to be
recognized by this new version? Or a way to install them
into the new version?
currently (apart from Apple's buggy ruby) i'm using two rubies install
one under /opt (MacPort) another one devoted to jRuby under my HOME/bin.
aliasing isn't sufficiant, u have also to setup your PATH such a way the
kernel hits /usr/local/bin before /usr/bin, afaik.
entering in ther terminal :
which ruby
gives you the "good" one ?
also did you setup in your env vars GEM_HOME, RUBYOPT and RUBYGEMS ?
another way to specify dirs is to use a ~/.gemrc see the on line man of
rubygems.
hoping that could help.
···
doog <doog@google.com> wrote:
so I downloaded Ruby 1.8.5 source from: http://www2.ruby-lang.org/en/20020102.html
which I installed in:
/usr/local/bin/rub
Now RubyGems and the libraries I had installed are not found.
I can run ruby with this alias:
ruby='/usr/local/bin/ruby'
Is there a way to get RubyGems and the libraries to be
recognized by this new version? Or a way to install them
into the new version?
you need to add "/usr/local/bin" to your PATH variable. It's apparent from this question that you don't understand some of the basics of OSX's UNIX shell behavior. Here's a link [1] to a set of basic UNIX tutorials which will give you a nice foundation for working in a shell environment going forward.
In the meantime, fire up Terminal.app and do the following:
1. cd $HOME
2. echo 'PATH=/usr/local/bin:$PATH' >> .profile
3. echo 'export PATH' >> .profile
Make sure you use single quotes instead of double quotes!
Quit Terminal.app and then reopen it. At the shell prompt type 'which ruby' to confirm it returns '/usr/local/bin/ruby' to you.
On Mac OS X 10.4.8, Ruby 1.8.2 is installed in /usr/bin/ruby
I installed RubyGems and several libraries.
I needed to upgrade to the latest version,
so I downloaded Ruby 1.8.5 source from: http://www2.ruby-lang.org/en/20020102.html
which I installed in:
/usr/local/bin/rub
Now RubyGems and the libraries I had installed are not found.
I can run ruby with this alias:
ruby='/usr/local/bin/ruby'
Is there a way to get RubyGems and the libraries to be
recognized by this new version? Or a way to install them
into the new version?
Thanks for the info about GEM_HOME. I set up /usr/local/bin
to be ahead of /usr/bin. I still have trouble getting the gems
to be loaded with the newer /usr/local/bin/ruby
Do I set:
GEM_HOME=/usr/lib/ruby/gems
or
GEM_HOME=/usr/lib/ruby/gems/1.8/gems
Also, it's not clear to what values to use for "user directory"
and the "mygemrepository" in the following (taken from the RubyGems
man page: http://rubygems.org/read/chapter/3)
Use the following to install RubyGems in a user directory
(here called /home/mystuff)
with a repository named /home/mygemrepository):
What happens when you say "gem environment" at the command line? m.
···
doog <doog@google.com> wrote:
Thanks for the info about GEM_HOME. I set up /usr/local/bin
to be ahead of /usr/bin. I still have trouble getting the gems
to be loaded with the newer /usr/local/bin/ruby
Do I set:
GEM_HOME=/usr/lib/ruby/gems
or
GEM_HOME=/usr/lib/ruby/gems/1.8/gems
Also, it's not clear to what values to use for "user directory"
and the "mygemrepository" in the following (taken from the RubyGems
man page: http://rubygems.org/read/chapter/3\)
Use the following to install RubyGems in a user directory
(here called /home/mystuff)
with a repository named /home/mygemrepository):
I think you've installed rubygems using /usr/bin/ruby, the Apple's one ?
may be you didn't change your PATH hit before ?
Do I set:
GEM_HOME=/usr/lib/ruby/gems
or
GEM_HOME=/usr/lib/ruby/gems/1.8/gems
neither only :
GEM_HOME=/usr/lib/ruby/gems/1.8
but i would suspect you could enter into trouble, if i'm right, that's
to say you've installed rubygems with Apple's Ruby...
personaly in such a situation i would re-install rubygems to insure it
is linked to the right ruby.
Also, it's not clear to what values to use for "user directory"
and the "mygemrepository" in the following (taken from the RubyGems
man page: http://rubygems.org/read/chapter/3\)
Use the following to install RubyGems in a user directory
(here called /home/mystuff)
with a repository named /home/mygemrepository):
I think you've installed rubygems using /usr/bin/ruby, the Apple's one ?
Yes. I installed rubygems when Apple's /usr/bin/ruby was the only
version on my Mac.
may be you didn't change your PATH hit before ?
You mean change PATH to include /usr/local/bin/ruby before installing
rubygems?
That would be correct, since /usr/local/bin/ruby didn't yet exist when
I installed rubygems.
personaly in such a situation i would re-install rubygems to insure it
is linked to the right ruby.
Okay, I did succeed re-installing ruby gems
$ cd rubygems-0.9.1
$ ruby setup.rb config --prefix=/usr/local
I figured out which value to pass in to --prefix by looking in
setup.rb: