Issue with Phusion Passenger handling multiple projects with multiple RVM rubies
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 :)
How do I upgrade RVM when the official way doesn't work?
Install RVM from scratch
1) First remove the current version, see: https://stackoverflow.com/a/3558763/1076207
# use sudo at your own discretion
rvm implode --force
gem uninstall rvm
rm -rf ~/.rvm
# open file
vim ~/.bash_profile
# remove lines:
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# close file
2) Follow the directions on the RVM install page: https://rvm.io/rvm/install
RVM - Automatically use a certain Ruby version for a given command?
rvm generates wrappers for you:
rvm wrapper 2.0.0 --no-prefix knife
rvm wrapper 1.9.2 --no-prefix sup
assuming you do not install this gems in all rubies the default from $rvm_path/bin/
will be used with loading proper ruby.
Wrong src-uri in rails app using font-awesome
I posted this after many hours of trying to resolve it and solved my own issue about five minutes later. Including the answer here for others that might find this:
It looks like I was using ENV['RAILS_RELATIVE_URL_ROOT'] improperly.
When I moved it to my asset precompile line like so:
RAILS_RELATIVE_URL_ROOT='/vns' rake assets:precompile
everything came out as expected. I'm not familiar enough with Rails to know what I was doing wrong or if there is a better way to solve this issue but this is fixes it for me.
Related Topics
Rails - How to Add Contacts to Sendgrid Marketing Campaigns via API
How to Write a Method That Counts the Most Common Substring in a String in Ruby
Importing CSV as Test Data in Cucumber
Create and Initialize Instances of a Class with Sequential Names
PDF Generation Hangs Using PDFkit and Wkhtmotopdf
Ruby: "Unexpected Keyword_End"... But All Openers and Closers Match
How to Get Data from Database in Ruby
Pass Ruby Script File to Rails Console
Override Vagrant Configuration Settings Locally (Per-Dev)
Webpack Error on Heroku Deployment
When Passing a Ruby Array as an Argument, Why Does '<<' Append While '+=' Does Not
Rails + Google Calendar API Events Not Created
Browser-Based Uploads Using Post
Rails Strong Params - Using Fields from Has_Many Object
How to Multiply "5X3" String in Ruby
Are Spies an Appropriate Approach to See If Resque Methods Are Being Fired