Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Gems installed to $HOME not recognized

Reply
Thread Tools

Gems installed to $HOME not recognized

 
 
Albert Schlef
Guest
Posts: n/a
 
      04-02-2010
I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
Ruby 1..

For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
sees gems I install as root.

In other words, if I do the following...

$ gem1.9.1 install haml

...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
when I do 'require "haml"' ruby says there's no such file to load.

On the other hand, when I do....

$ sudo gem1.9.1 install haml

...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
doing 'require "haml"' works.

I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
~/.gem/ruby/1.9.1.

My question:

How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Andrew Theaker
Guest
Posts: n/a
 
      04-07-2010
[Note: parts of this message were removed to make it a legal post.]

I found that it was a lot of hassle trying to get Ruby1.9 setup on Ubuntu,
particularly if you wanted to switch between 1.8 and 1.9.

Then I found rvm http://rvm.beginrescueend.com/ which has made the whole
process very easy to manage. I removed all my ruby packages except for 1.8
and gems then followed the installation instructions for rvm using the gem
method.

Hope it helps you!

On Fri, Apr 2, 2010 at 12:31 PM, Albert Schlef <(E-Mail Removed)>wrote:

> I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
> Ruby 1..
>
> For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
> sees gems I install as root.
>
> In other words, if I do the following...
>
> $ gem1.9.1 install haml
>
> ...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
> when I do 'require "haml"' ruby says there's no such file to load.
>
> On the other hand, when I do....
>
> $ sudo gem1.9.1 install haml
>
> ...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
> doing 'require "haml"' works.
>
> I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
> ~/.gem/ruby/1.9.1.
>
> My question:
>
> How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
 
 
 
Jesper Fruergaard Andersen
Guest
Posts: n/a
 
      04-13-2010
I had the same problem on Ubuntu 9.10. Setting the environment
variable GEM_HOME to the location of my gems seems to work.

On Fri, Apr 2, 2010 at 1:31 AM, Albert Schlef <(E-Mail Removed)> wrot=
e:
> I'm using Ruby 1.9, Ubuntu (I don't have the following problem with my
> Ruby 1..
>
> For some reason, Ruby 1.9 doesn't see gems I install to $HOME. It only
> sees gems I install as root.
>
> In other words, if I do the following...
>
> =A0$ gem1.9.1 install haml
>
> ...the gem gets installed in ~/.gem/ruby/1.9.1/gems/haml-2.2.22, and
> when I do 'require "haml"' ruby says there's no such file to load.
>
> On the other hand, when I do....
>
> =A0$ sudo gem1.9.1 install haml
>
> ...the gem gets installed in /var/lib/gems/1.9.1/gems/haml-2.2.22, and
> doing 'require "haml"' works.
>
> I temporarily solved the problem by symlinking /var/lib/gems/1.9.1 to
> ~/.gem/ruby/1.9.1.
>
> My question:
>
> How can i make Ruby 1.9 see the gems installed at ~/.gem/ruby/1.9.1 ?
> --
> Posted via http://www.ruby-forum.com/.
>
>




--=20
Jesper

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gems directory not getting installed Parv G. Ruby 1 08-20-2010 04:28 PM
Ruby/IRB not seeing installed Gems, thoughts? Matthew Williams Ruby 2 01-06-2008 01:01 AM
Gems -- #include <gems.hpp> Tomás C++ 7 03-05-2006 02:48 PM
gems not recognized -- can't fake fox14 bwv549 Ruby 2 11-11-2005 10:47 PM
Confusion about gems and non-gems working together. Lloyd Zusman Ruby 3 06-20-2005 11:23 PM



Advertisments