DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Alexey has posted 28 posts at DZone. View Full User Profile

Install Ruby 1.9.2 On Rails 3 Inside RVM And Make Project-specific Gem Set

06.05.2011
| 8628 views |
  • submit to reddit
        If you had global rvm install before, you might need to check /etc/rvmrc file

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

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
source /etc/profile.d/rvm.sh


Add these lines to ~/.bashrc:
# This loads RVM into a shell session.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

Run following to test RVM and install pre-requirements specified there:
rvm notes

Install default Ruby 1.9.2 and test it:
rvm install 1.9.2
rvm --default ruby-1.9.2 
ruby -v

Create project-specific gemset, make it default, install Rails with pre-requirements:
rvm gemset create my_project
rvm use 1.9.2@my_project --default

Then either create a new project:
gem install rails
rails my_project

Or install dependencies for an existing project:
cd my_project
gem install bundle
bundle install