Rails 3: Passenger can't find git gems installed by bundler

Viewed 28282

Rails 3.0.0, Passenger 2.2.15:

  • Create a new Rails project
  • Add gem 'paperclip', :git => 'git://github.com/lmumar/paperclip.git', :branch => 'rails3' to your Gemfile
  • Do bundle install
  • Everything OK, starting with rails/script server & accessing also works
  • However, when accessing with Passenger, it says:

git://github.com/lmumar/paperclip.git (at rails3) is not checked out. Please run bundle install (Bundler::GitError)

I have tried bundler pack (doesn't help) and setting BUNDER_HOME to ~/.bundler (the Paperclip git gets installed there by bundler install) in the .htaccess and various places in config/*.rb, but this wasn't successful, too.

~/.bundler is owned by the same user as the Rails project (Passenger runs under this user), so it can't be a permission problem. sudo is installed and called by bundle install.

Any hints?

6 Answers

Im used to have this problem, resolve using

bundle --deployment

Which will install the gems in vendor/bundle

I installed the passenger gem and its apache module as a sudo user and that was the problem in my case.

The reason why I used sudo initially was that I copied the code from railscasts' episode 122. Installing it without sodu access resolved this issue. Since Ruby was installed using rvm without the sudo access on my system.

Related