RVM, Ruby 1.9.2, Rails 3, Passenger 3.0.2 (Bundler::GemNotFound)

I'm using RVM, Ruby 1.9.2, Rails 3, Passenger 3.0.2 configured for Nginx, I setup server configuration correctly. Another app working so far.

But for the new app, when booting server

http://myapp.local (its configured with hosts to point server bind on Nginx conf) It returns (Bundler::GemNotFound) error. How to get around this?



Believe it or not this is a very common problem most Rails Developers will come across. Have a look at this post which details the fix I think you are looking for. Best of luck. http://dalibornasevic.com/posts/21-rvm-and-passenger-setup-for-rails-2-and-rails-3-apps


For a clearer and up to date solution, check out the official docs page on using RVM rubies with Passenger.

For the gist of it, add

if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm') begin gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems') ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global" require 'rvm' RVM.use_from_path! File.dirname(File.dirname(__FILE__)) rescue LoadError raise "RVM gem is currently unavailable." end end # If you're not using Bundler at all, remove lines bellow ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__)) require 'bundler/setup'

to your <rails-app-path>/config/setup_load_paths.rb.


For rvm based apps and Passenger, you may refer to these docs:

https://rvm.io/integration/passenger http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerRuby

My particular problem was that I didn't have the passenger gem installed in the current gemset:

$ gem list --local |grep passenger # returns nothing

To install the plugin and the Apache module, I've executed the following sequence of commands:

$ gem install passenger # for a specific version use the '--version' flag $ gem list --local |grep passenger passenger (4.0.18) $ passenger-install-apache2-module

After the installation the script printed instructions how to set the PassengerDefaultRuby variable in Apache's config. Voilà! - no extra scripts and LOAD_PATH manipulation ;)


I don't know why, but I installed the missing Gem in Global Gemset and it works!


  • RVM on Ubuntu Troubles
  • Installing Ruby 2.0.0 using RVM with errors in configure
  • Slow loading rails environment
  • symlink warning during rails app deploy with capistrano
  • Open source augmented reality framework for BlackBerry
  • Placeholder text-overflow:ellipsis in IE10 not working
  • Tornado non-blocking SMTP client
  • Connection made to Google Cloud SQL drops intermittently
  • Why is YAML.load returning the wrong numeric value?
  • Rails4 and Devise (NoMethod error)
  • 500 internal server error in ruby on rails
  • What is the official release update URL for Aptana Studio 3.0?
  • Dispose not working as expected in DirectorySearcher
  • Fluid video height
  • Weird LEFT OUTER JOIN on Includes eager loading of rails 3
  • How do I capture a rsolr Sunspot exception raised on a different thread from a model callback?
  • What does certain JVM do after loading ByteCode into memory?
  • How can i dump blob fields from mysql tables
  • Automatically associate new Sonar project with custom quality profile and quality gate
  • Zurb Foundation _global.scss meta styles for js?
  • Webgrid not refreshing after delete MVC
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • How to avoid particles glitching together in an elastic particle collision simulator?
  • Recording logins for password protected directories
  • Illegal mix of collations for operation for date/time comparison
  • Splitting given String into two variables - php
  • Fetching methods from BroadcastReceiver to update UI
  • Excel - Autoshape get it's name from cell (value)
  • Check if a string to interpolate provides expected placeholders
  • htaccess rewriting URLs with multiple forward slashes
  • Display Images one by one with next and previous functionality
  • Release, debug version and Authorization Google?
  • Web-crawler for facebook in python
  • QuartzCore.framework for Mono Develop
  • RestKit - RKRequestDelegate does not exist
  • Traverse Array and Display in markup
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • A cron job substitute?
  • Hits per day in Google Big Query
  • Reading document lines to the user (python)