# Really need help with gems not being found

**URL:** <https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041>\
**Category:** Rails\
**Created:** [October 5, 2010, 11:11pm UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041 "2010-10-05T23:11:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 5, 2010, 11:11pm UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/1 "2010-10-05T23:11:02Z")

</div>

I love Rails, but I’m beginning to think that there are some very  
broken things about it. Case in point:

- I’m on OS X, and at some point added rails using MacPorts, putting  
most of my gems in /opt/local/lib/ruby/gems/1.8

- when I add gems, they are added in that directory BUT

- when I run (eg) rake tasks, the gems are not found. I’ve tried  
using

ENV[‘GEM\_PATH’] = ‘/opt/local/lib/ruby/gems/1.8’

to force the app to only look there, but it still doesn’t see them. I  
get messages like

Missing these required gems:  
rmagick  
authlogic

You’re running:  
ruby 1.8.7.174 at /System/Library/Frameworks/Ruby.framework/Versions/  
1.8/usr/bin/ruby  
rubygems 1.3.5 at /opt/local/lib/ruby/gems/1.8, /Library/Ruby/Gems/  
1.8

Run `rake gems:install` to install the missing gems.

Which I do, using sudo, and everything seems to go fine, but when I  
run rake again, they aren’t seen.

Where am I going wrong? What is wrong with Rails that this can’t be  
configured simply? What is wrong with me that I can’t figure this out?

---

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 5, 2010, 11:13pm UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/2 "2010-10-05T23:13:58Z")

</div>

On Oct 5, 7:39 pm, omnivore [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ruby 1.8.7.174 at /System/Library/Frameworks/Ruby.framework/Versions/  
> configured simply? What is wrong with me that I can’t figure this out?  
> You have 2 ruby installs (one in /opt and one in /lib) and you are  
> installing gems into one install but then running rake from the other  
> one. You could either get rid of one of the installs or make sure that  
> your /opt ruby has rake installed and that $PATH is such that ruby/  
> rake/gem are all picked from the same ruby install.

Fred

---

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 5, 2010, 11:22pm UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/3 "2010-10-05T23:22:29Z")

</div>

omnivore wrote:

> I love Rails, but I’m beginning to think that there are some very  
> broken things about it.  
> […]

As Fred said, Rails isn’t broken. Your Ruby installation is. Next  
time, ask for help without creating FUD.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 6, 2010, 3:09am UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/4 "2010-10-06T03:09:48Z")

</div>

Solution was simple, once I found it. Change the bang line in the  
rake.rb, found via ‘which rake’ to point to the ruby version that  
houses the gems. Now things work.

Put differently, now its not broken. The breakage came as a result of  
Rails using the $PATH variable when installing gems, not when it runs  
rake. So, yes, rails is broken in this case – this underdocumented  
behaviour arose not out of misconfiguration, but the normal use of the  
$PATH producing a non-functional behaviour.

Next time, feel free to provide an actual answer, or refrain from  
answering if the best contribution is limited to patronizing snark.

BTW, are you wearing shoes these days? Don’t want to hurt your feet  
when you’re Morris Dancing Ze’ev. Or should I call you Lord Marnen of  
Wolfhurst?

heheheh.

---

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 6, 2010, 3:53pm UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/5 "2010-10-06T15:53:03Z")

</div>

Colin, I naturally did send Frederick C. (hope I have the name  
right) thanks directly, although his answer did not actually solve the  
problem, and reiterated advice that I also found on (IIRC)  
stackoverflow. He did clue me in to checking the locations of ruby,  
rake and gems, and I found another clue on another site, where a  
similar problem was documented. Of course, I thanked that person  
profusely. I think that’s pretty much adequate, and if anyone here had  
solved the problem, of course I would have thanked them. I understand  
quite clearly how these exchanges work.

The point of my last post was that one respondent seemed more focussed  
on topics irrelevant to my question, made remarks that were  
gratuitously judgmental, and what he contributed was unhelpful to  
others with a similar problem. Signal to noise is important, is it  
not?

Other than that – and with no desire to extend this uneccesarily –  
what point of etiquette did I miss, in your opinion?

---

<div class="post-metadata">

**Author:** ![omnivore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e47774/32.png) [@omnivore](https://www.ruby-forum.com/u/omnivore)\
**Post date:** [October 6, 2010, 8:59am UTC](https://www.ruby-forum.com/t/really-need-help-with-gems-not-being-found/196041/6 "2010-10-06T08:59:45Z")

</div>

On 6 October 2010 02:08, omnivore [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Solution was simple, once I found it. Change the bang line in the  
> rake.rb, found via ‘which rake’ to point to the ruby version that  
> houses the gems. Now things work.

Don’t bother thanking anyone for pointing you at the cause of the  
problem. They are only in it for the money anyway.

Colin
