Cannot find gem for Rails error from dispatch.cgi

Hi All,

I’m developing a Rails app with Rails v1.1.4, but when I upload it to
Dreamhost and try to serve it with dispatch.cgi, I get the error “Cannot
find
gem for Rails =1.1.4”. However, I have installed the 1.1.4 gem in my
home
directory and set GEM_PATH to look there; additionally, rake throws no
errors
and “rails -v” displays “Rails 1.1.4”. Any ideas?

Thanks!
Daniel H.

A bit of comprehension refusal. I cannot use the
_singular_ids method. Is there a scope issue ?

J-C

class User
has_many :roles
end

Great !

user = User.new

Still great !

user.first_name = ‘Sally’

Things could not be better : )

user.roles << [some collection]

Ditto, works fine.

user.roles.empty?

Kaboom ->->->-> NO METHOD ERROR

user.roles_singular_ids [2, 3]
NoMethodError: undefined method roles_singular_ids' for #<User: 0x26d0334> from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/ lib/active_record/base.rb:1792:inmethod_missing’
from (irb):2

Daniel H. wrote:

Hi All,

I’m developing a Rails app with Rails v1.1.4, but when I upload it to
Dreamhost and try to serve it with dispatch.cgi, I get the error “Cannot find
gem for Rails =1.1.4”. However, I have installed the 1.1.4 gem in my home
directory and set GEM_PATH to look there; additionally, rake throws no errors
and “rails -v” displays “Rails 1.1.4”. Any ideas?

I don’t know Dreamhost’s webserver setup, but have you made sure that
GEM_PATH can be read by the (Apache?) user the webserver runs under? And
is the environment variable set specifically for that user?

Jean-Charles Carelli wrote:

A bit of comprehension refusal. I cannot use the
_singular_ids method. Is there a scope issue ?

NoMethodError: undefined method `roles_singular_ids’ for #User:0x26d0334

collection_singular_ids=ids should be read as
<collection_singular>_ids=ids.
That is, you want:

role_ids = …

I think this could be made clearer in the API docs.


We develop, watch us RoR, in numbers too big to ignore.

I know that I’ve used gems installed in GEM_PATH before, but in any case
I
sidestepped the problem by doing rake rails:freeze:gems. Thanks though
:slight_smile:

Daniel

Many thanks for the syntax help. Works fine now.

J-C