Skip to content

Instantly share code, notes, and snippets.

@leommoore
Last active October 2, 2015 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leommoore/2168785 to your computer and use it in GitHub Desktop.
Save leommoore/2168785 to your computer and use it in GitHub Desktop.
Installing Rails on Ubuntu

#Installing Rails on Ubuntu

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
----------------------------------------------------------------

sudo apt-get install build-essential git-core curl python-software-properties

curl -L https://get.rvm.io | bash -s stable --ruby --auto-dotfiles

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc 

. ~/.bashrc

rvm requirements

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl 
sudo apt-get install git-core zlib1g zlib1g-dev libssl-dev libyaml-dev
sudo apt-get install libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
sudo apt-get install libxslt-dev autoconf libc6-dev ncurses-dev
sudo apt-get install automake libtool bison subversion

rvm install 1.9.3-p374
rvm use 1.9.3-p374
rvm --default use 1.9.3-p374

gem install rails

sudo apt-get install nodejs
--------------------------------------------------------------------------
Installing Postgres

sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql libpq-dev

sudo -u postgres psql
postgres=# \password
Enter new password: 
Enter it again:

postgres=# create user blog with password 'secret';
CREATE ROLE
postgres=# create database blog_production owner blog;
CREATE DATABASE

rake db:migrate RAILS_ENV="production"

#Useful Postgres commands
sudo /etc/init.d/postgresql stop
sudo /etc/init.d/postgresql start
 
--------------------------------------------------------------------------
rails server -e production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment