Question

Trying to get Rails, RVM, Apache, MySQL running on Ubuntu 12.04

  • Posted March 27, 2014

Hello, I setup a droplet and chose Ubuntu 12.04. I added Ruby/Rails but realized it came with Redmine which is a nice proof of functionality at runtime but I don’t need it. Upon further inspection I realized it’s running Ruby 1.87 and that’s not an option.

I setup rvm as a root user. Pushed my rails app code over to the instance, installed Ruby 2.1.1, ran bundle install to get all my gems installed and once I had migrated and populated my database, voila, I have an instance that can run from the command line (i.e. rails server). I am able to interact with it on port 3000 (the default) via an external system and all works fine. All great stuff. Now for the interesting part.

I want to run this same setup on Apache via phusion/passenger. The version in that instance looked a bit dated so I went through the update process. I can’t seem to get my instance running. When I try to start it I get errors indicating that:

“It looks like Bundler could not find a gem. Maybe you didn’t install all the gems that this application needs. To install your gems, please run: bundle install”. My assumption is that it’s finding the wrong ruby/gems. Any help here would be appreciated.

I added the following lines to the end of my apache2.conf file:

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.1@rails-3.2.14/gems/passenger-4.0.40/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-2.1.1@rails-3.2.14/gems/passenger-4.0.40 PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.1@rails-3.2.14/wrappers/ruby </IfModule>

Stumped. Thanks in advance.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Turned out when I looked at the stack frame the bundler wasn’t able to install the “squeel” gem. It was specified in my Gemfile as: <br>gem ‘squeel’, :git => “git://github.com/ernie/squeel.git” <br> <br>Oddly it works when run from command line but not via passenger.