Reputation: 6918
Hey I've deployed one of my Rails app in the server using phusion Passenger(4.0.20)
and Rails 3.0.3
and Ruby ruby-1.8.7-p374
. In the same system, we are managing other rails projects also with other Rails and Ruby versions. We are using RVM
to manage rubies.
Doing rvm list shows:
rvm rubies
ruby-1.8.7-p371 [ x86_64 ]
=* ruby-1.8.7-p374 [ x86_64 ]
ruby-2.0.0-p353 [ x86_64 ]
ruby-2.0.0-p451 [ x86_64 ]
ruby-2.1.0 [ x86_64 ]
ruby-2.1.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
The project that I've problem while running is using ruby-1.8.7-p374
and Rails 3.0.3
. Now when I take the URL, it shows the below given error.
Restarted apache, restarted passenger, but we are getting issues with ruby-2.0.0-p451
which we have installed for managing another Rails application.
What could be the reason? Please help :)
Upvotes: 3
Views: 246
Reputation: 18944
I see two issues here:
On a side note, you should upgrade to the latest version of Phusion Passenger, 4.0.41, for the latest bug fixes.
Upvotes: 0
Reputation: 6918
Go to the project directory and run the below commands one by one:
rvm use ruby-1.8.7-p374
gem install bundler passenger
rvm passenger-install-apache2-module
This will install passenger along with Apache module, mean while you will be asked to add some configuration changes to /etc/apache2/apache2.conf
and do it as such.
Create a file in /etc/apache2/sites-available/
for your site (something like 'www.virtualx.com') and insert this:
<VirtualHost *>
# Change these 3 lines to suit your project
RailsEnv production
ServerName www.virtualx.com
DocumentRoot /var/www/my_project/public # Note the 'public' directory
</VirtualHost>
and set the PassengerRuby
option to ruby-1.8.7-p374
.
Restart Apache service. You are all done.
Now it will work ok.
If you need multiple ruby versions working simultaneously for different projects, then refer here.
Hope it helps :)
Upvotes: 0
Reputation: 988
Do you have a .ruby-version in your project directory? Your project is trying to load ruby-2.0.0-p451
instead of ruby-1.8.7-p374
Have a .ruby-version in your project dir with the set version you want, ie, ruby-1.8.7-p374
and try.
Use rvmrc or ruby-version file to set a project gemset with RVM?
Upvotes: 0