Forum: Ruby on Rails can load gem with irb but application fails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
10da297eedcca67860268ec3490f6f06?d=identicon&s=25 dino d. (Guest)
on 2008-10-23 12:27
(Received via mailing list)
Hi-

I'm trying to load the blackbook gem.  I had it working at one point
and don't recall how I broke it.  Anyway, right now, I can load it in
irb and I get 'true' (success).  The app dies, however and I get this
in the log:

MissingSourceFile (no such file to load -- blackbook):
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/
dependencies.rb:510:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/
dependencies.rb:355:in `new_constants_in'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/
dependencies.rb:510:in `require'
    /app/controllers/friends_controller.rb:4
...

So, it sounds like irb is using one gem path and the application is
using another.  I'm sure the gem is there, and this is a hosted app so
I don't have root.  (The app works fine on my dev machine).

Can someone push me in the right direction?

Thanks,
Dino
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-10-23 15:24
(Received via mailing list)
It sounds like your app is relying on the gems installed on the
production
server. Instead, you should consider bundling your gems with your app.
Good
coverage of gem dependencies is here [
http://ryandaigle.com/articles/2008/4/1/what-s-new...]
and here [
http://railscasts.com/episodes/110 ].

Regards,
Craig
10da297eedcca67860268ec3490f6f06?d=identicon&s=25 dino d. (Guest)
on 2008-10-23 22:01
(Received via mailing list)
On Oct 23, 9:23 am, "Craig Demyanovich" <cdemyanov...@gmail.com>
wrote:
> It sounds like your app is relying on the gems installed on the production
> server. Instead, you should consider bundling your gems with your app. Good


ahh, so there's more to it than just the $GEM_PATH and $GEM_HOME env
vars?
6b4944d281602b93e09839bf22adffd8?d=identicon&s=25 Fred Talpiot (namealreadytaken)
on 2008-11-05 13:36
(Received via mailing list)
When you issue the original 'rails' command, to populate the
directory, it seems to embed gem version numbers here and there.  Try
creating a virgin directory with and diffing the created files with
the stuff in your directory.  Especially the config and environment
stuff.

Also see
http://wiki.rubyonrails.org/rails/pages/HowToUseMu...

You can use multiple gem repositories at the same time that way.  Your
rails console should use the same gem version as your web app, so test
it there first.

I don't know anything about blackbook, never heard of it.

Fred 2
This topic is locked and can not be replied to.