Forum: Ruby on Rails Confusion over installed versions

8bbc940838807cdded0d4a3b69ab51cf?d=identicon&s=25 John B. (john_b92)
on 2013-10-05 17:50
(Received via mailing list)
Hi

I have got confused by ruby/gems etc as i seem to have some kind of path
issues somehow. First issue is i seem to have 3 flavours of ruby
installed
...

# ruby -v
ruby 1.9.3p374 (2013-01-15) [i686-linux]

# /opt/ruby-enterprise-1.8.7-2012.01/bin/ruby -v
ruby 1.8.7 (2011-12-28 MBARI 8/0x8770 on patchlevel 357) [i686-linux],
MBARI 0x8770, Ruby Enterprise Edition 2012.01

# /opt/ruby/bin/ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-linux]

# grep ruby /etc/httpd/conf/httpd.conf
LoadModule passenger_module
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /opt/ruby/bin/ruby


So i guess i am using /opt/ruby/bin/ruby for live web site?

So then when i try to do anything with the gem command it is not
happy...

# gem -v
/usr/bin/ruby: No such file or directory --  '--prefix=/usr' (LoadError)

# /opt/ruby-enterprise-1.8.7-2012.01/bin/gem -v
1.8.15

/opt/ruby/bin/gem -v
/usr/bin/ruby: No such file or directory --  '--prefix=/usr' (LoadError)


Im assuming that i need to be using "gem -v" which in turn is the same
as
"/opt/ruby/bin/gem -v"? But neither works.

Any idea how to set a path or some such so i can use the gem commands? I
have Googled a bit but havent found a good (understandable!) answer.
Also
how do i uninstall the unused ruby versions?

Thanks in advance.

John
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2013-10-05 19:12
(Received via mailing list)
On 2 October 2013 15:36, John Bayes <logica111@hotmail.com> wrote:
> Hi
>
> I have got confused by ruby/gems etc as i seem to have some kind of path
> issues somehow. First issue is i seem to have 3 flavours of ruby installed

Use rvm (or rbenv, but I have not personal experience of that) to
manage ruby and gems.

Colin
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.