Professional Documents
Culture Documents
Thekindofme: October 24, 2010
Thekindofme: October 24, 2010
com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/
theKindOfMe
October 24, 2010
Rails 3 on Ubuntu 10.10 with RVM, Passenger and Nginx
This covers setting up a Ubuntu 10.10 box to run rails 3 on production. Please
notice it only focus on installing and setting up things mentioned in the title.
However there are other things that you should configure and setup when
deploying a application to production (like ntpd for example).
Installing RVM
add
1 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a
shell session.
to your .bashrc.
Once you edit your bashrc file execute the following to load rvm without logging
out and back in
1 source ~/.rvm/scripts/rvm
Just to be safe check wether rvm is a function, which is what it should be.
1 type rvm | head -n1
See what you get out of rvm notes. you will need to install some stuff before you
can compile ruby.
1 aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git-core
zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
libmysqlclient-dev
The above packages covers some common stuff. It should be enough to get you
started. However depending on what gems you want to install you might need to
install additional dependencies.
1 rvm install 1.9.2
Passenger
From: http://github.com/jnstq/rails-nginx-passenger-ubuntu
1 cd
2 git clone git://github.com/jnstq/rails-nginx-passenger-ubuntu.git
3 sudo mv rails-nginx-passenger-ubuntu/nginx/nginx /etc/init.d/nginx
4 sudo chown root:root /etc/init.d/nginx
MySQL
Get the source for your rails app. unzip it in your home folder (or where ever you
want to. But be sure to edit the nginx config as appropriate).
1 cd to-your-rails-app-folder
2 bundle install
3 rake db:setup RAILS_ENV=production
4
5 sudo /etc/init.d/nginx restart
Thats it!
Comments (3)
3 Comments »
1.
instead:
source ~/.rvm/src/rvm/scripts/rvm
so if you get any message that it cannot find the rvm script or that it thinks
rvm is a directory, please traverse the path and find out exactly where curl
places the script files.
Reply
RVM must have changed its directory structure. Yep thats the case.
Reply
2.
- this is closer to what you would do after you have installed Ubuntu and
contains CURL which you need to install RVM.
Reply
Leave a comment
Name (required)
E-mail (required)
Website
Submit Comment
Search
Pages
About
Recent Posts
Tags
.net .netcf art asp.net asp.net mvc bug code debian logo firefox games
greasemonkey hardware javascript jQuery linux movies music mvc netbeans
networking notes oo p2p paranoia perl personal photos qBittorrent rails rant rants recursion
rss blogger ruby ruby on rails slt adsl svn swirls tips torrenting ubuntu
ubuntu. linux vss windows winforms
Fork me on github
last.fm
Flickr Photos
More Photos
visitors
Tweets
SL Police is a bloody joke, when they publish pics of 'porn actresses'. I
guess no minister have invested in the porn industry yet.... 9 hours ago
thinking of using the compartment for the hydration pack in the
backpack for the laptop. good that it have a extended apple care plan ;)
9 hours ago
@dinuks yeah the streets are so packed like private bus at home ;-)
11 hours ago
When people say little india can be crowded in the weekends they
really mean it. 11 hours ago
Wish the rain will stop. Is a sunday. Why does it have to rain on a
sunday. 13 hours ago
Archives
November 2010
October 2010
September 2010
August 2010
July 2010
May 2010
April 2010
February 2010
January 2010
November 2009
October 2009
August 2009
July 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
June 2008
April 2007
March 2007
February 2007
January 2007
Blogroll
ubuntu
Co Workers
ෙපාඩ්ඩාෙග් ෙලා්කය
Meta
Register
Log in
Entries RSS
Comments RSS
WordPress.com
Blog at WordPress.com.