log in as root
remove old ruby
ruby packeges list
dpkg -l | grep ruby
then remove all ruby ββpacks
aptitude purge <package name>
if you have rvm installed
rvm remove all
then
rvm implode
or
rvmsudo rvm implode
install ruby
still registered as root
install all the necessary tools and libraries
apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev
install rvm
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Then add this line as the last line in your .bashrc:
nano ~/.bash_profile if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
check RVM installation
rvm notes
Then you can start the installation of ruby ββ1.9.2 by running
rvm install 1.9.2
The installation will take up to several minutes, and after its completion you should install ruby ββ1.9.2 as the default version
rvm --default ruby-1.9.2
check out the new ruby ββinstallation ruby -v
install rails 3
gem install rails
If you want to quickly create a database and work with sqlite, you will need sqlite3 and libsqlite3-dev packages
apt-get install sqlite3 libsqlite3-dev gem install sqlite3-ruby
create a new application
rails new testapp cd testapp
Make sure you are in your test application and run
rails s
Open a browser. http: // localhost: 3000
source share