I'm using nginx, rvm and passenger to run a web server for a Rails project (i.e., project1). This project has a specific gemset defined for it. I now need to run a second project (i.e., project2) which uses a different set of gems (and has a different gemset defined). How can I accomplish that?
This is what my configuration file for nginx looks like:
http {
passenger_root /var/www/project1/vendor/cache/ruby/1.9.1/gems/passenger-3.0.
19;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p320@global/ruby;
# ...
server {
listen 80;
server_name project1.example.com;
root /var/www/project1/public;
passenger_enabled on;
rails_env production;
# ...
}
server {
listen 80;
server_name project2.example.com;
root /var/www/project2/public;
passenger_enabled on;
rails_env production;
# ...
}
# ...
}
project1 works as expected. However, project2 gives me missing gem errors.
Could not find i18n-0.6.4 in any of the sources (Bundler::GemNotFound)
Note how passenger_root points to the passenger gem within project1.
Any pointers on how I can run both projects, would be greatly appreciated. Thank you.