Ruby on Rails: rvm [some struggle]

After destroying all ruby...
http://beginrescueend.com/
http://screencasts.org/episodes/how-to-use-rvm

bash < <(curl -s <a href="https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer" title="https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer">https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer</a>)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
cd ~
source .bash_profile

See requirements:

rvm requirements

And install for ruby:

apt-get install 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

And for Jruby:

sudo apt-get install curl g++ openjdk-6-jre-headless
sudo apt-get install ant openjdk-6-jdk

And...

rvm list known
/code>
 
And finally lets install 1.9.2. Don't want to install latest 1.9.3...
<code>
rvm install 1.9.2
rvm use 1.9.2
 
ruby --version
  ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

Solving problems with rails 3.1.1

I installed rails 3.1.1 and this got me into other problems with rails...
So trying:

gem install rails
gem install execjs
gem install therubyracer
bundle install

Didn't work...

But adding this to Gemfile [located in project folder] helped:

gem 'execjs'
gem 'therubyracer'

Then running bundle install and finally: rails server

Worked fine. After adding 1.9.3:
RVM - works ok!

wkaczurba@wkaczurba:~/tmp$ rvm list
 
rvm rubies
 
   ruby-1.9.3-head [ i686 ]
   ruby-1.9.2-p290 [ i686 ]
 
wkaczurba@wkaczurba:~/tmp$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
wkaczurba@wkaczurba:~/tmp$ rvm use 1.9.3
WARN: ruby ruby-1.9.3-p0 is not installed.
To install do: 'rvm install ruby-1.9.3-p0'
wkaczurba@wkaczurba:~/tmp$ rvm use 1.9.3-head
Using /home/wkaczurba/.rvm/gems/ruby-1.9.3-head
wkaczurba@wkaczurba:~/tmp$ 

Worked fine as well!