I've been setting up multiple Ubuntu machines from past 1 year and so writing down the steps that I have compiled after hours of frustration and research.
DISCLAIMER : There are steps like these on many blogs but they did not work for me (hence this list). The steps mentioned below may also not work for you.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3\curl -sSL https://get.rvm.io | bash -slogout and login again (close the terminal and open it again)- type this on the terminal window :
source ~/.rvm/scripts/rvm - Check if RVM was installed properly, type :
rvm | head -n 1(output should be “=rvm”) rvm install 2.2rvm use 2.2sudo apt-get install nodejssudo apt-get install gitsudo apt-get install libmysqlclient-devsudo apt-get install libgmp-devgem install mysql2gem install bundler
After this point, you should set up your directories with your code in the server. Once you do that then do these steps
bundle install(do it in all the code directories)sudo apt-get install apache2sudo apt-get install libcurl4-openssl-devsudo apt-get install apache2-threaded-devgem install passenger(first try without sudo, if it fails then prepend “sudo” and run the command again)passenger-install-apache2-module(if you used sudo in the above step, use sudo here, else don’t)
Now sit back and relax or grab a cup of coffee. Passenger will take around 10-15 mins (depending on your internet connection speed) to finish.
Once its done, it will print a configuration on the screen. Copy that and do the below step
cd /etc/apache2sudo nano apache2.conf- go the bottom of the conf file and paste the lines you copied
- Now do this :
cd /etc/apache2/sites-available sudo nano 000-default.conf- add the below lines at the end
<VirtualHost *:80>
# Change these 3 lines to suit your project
RailsEnv development
ServerName dev.blah.com
DocumentRoot /your/website/path/public # Note the 'public' directory
</VirtualHost>
Hope this helps!