Again the vendor directory

Dear all,

Rails is slowly driving me nuts, and I hope you can prevent that from
actually happening. I am currently developing an app which uses OpenID
as a login system. It requires the gem ruby-openid which in turn depends
on ruby-yadis. On my development box I just installed these gems and
there was much love. However on the shared server on which I am going to
deploy these gems are, understandably, not present. But Rails would not
be Rails if it didn’t have some clever solution for this.
Enter the vendor directory. In the vendor dir I did “gem unpack
ruby-openid;gem unpack ruby-yadis” which results in two directories. I
added these to the svn and redeployed using capistrano. But still I got
the MissingSourceFile exception. After reading some post I figured I
needed to add the relevant directories to the config/environment.rb;
“config.load_paths += %W( #{RAILS_ROOT}/vendor/ruby-openid-1.1.4/lib )
config.load_paths += %W( #{RAILS_ROOT}/vendor/ruby-yadis-0.3.4/lib )”
Now ‘script/console production’ neatly accepts a ‘require “openid”’
however my app still throws a MissingSourceFile exception! My question
of course is; how is this possible? Any hints will be greatly
appreciated, if not by me then by my SO. :slight_smile:

With kind regards,
Harm

Harm Aa wrote:

Dear all,

Rails is slowly driving me nuts, and I hope you can prevent that from
actually happening. I am currently developing an app which uses OpenID
as a login system. It requires the gem ruby-openid which in turn depends
on ruby-yadis. On my development box I just installed these gems and
there was much love. However on the shared server on which I am going to
deploy these gems are, understandably, not present. But Rails would not
be Rails if it didn’t have some clever solution for this.
Enter the vendor directory. In the vendor dir I did “gem unpack
ruby-openid;gem unpack ruby-yadis” which results in two directories. I
added these to the svn and redeployed using capistrano. But still I got
the MissingSourceFile exception. After reading some post I figured I
needed to add the relevant directories to the config/environment.rb;
“config.load_paths += %W( #{RAILS_ROOT}/vendor/ruby-openid-1.1.4/lib )
config.load_paths += %W( #{RAILS_ROOT}/vendor/ruby-yadis-0.3.4/lib )”
Now ‘script/console production’ neatly accepts a ‘require “openid”’
however my app still throws a MissingSourceFile exception! My question
of course is; how is this possible? Any hints will be greatly
appreciated, if not by me then by my SO. :slight_smile:

With kind regards,
Harm

As an addendum, I verified whether or not the $LOAD_PATH is set
correctly in my openid_controller by making a dummy view which does
nothing but prints the $LOAD_PATH on (browser) screen. From that output
I can see that the $LOAD_PATH is not properly set. It is not the
same as when running ‘script/console production’. How is this possible??

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs