Programming in ruby or rials – ror: Ubuntu 10 Ruby 1.9 Rails 3 not working? (Solved) on newest questions tagged ruby-on-rails – Stack Overflow

Hi hope there is someone out there that can help me, have been struggling with this for quite some time now. Im running Ubuntu 10 on the dev machine wich had ruby 1.8 on it, wich I removed. I installed Ruby 1.9.3 and rails3 using RVM and this tutorial http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/


when I type ruby -v I get

ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]

wich seems correct

I created a new test app using

rails new mysite

wich created the new app successfully
then I

cd mysite

and created a gemset

rvm gemset create 'rails3'

then I used this inside the /mysite/ folder

rvm use 1.9.3@rails3 --rvmr
Using /usr/local/rvm/gems/ruby-1.9.3-p125 with gemset rails3

but the problem arises when i try to run it

root@server-pc:/var/www/mysite# rails s
-bash: /usr/bin/rails: /usr/bin/ruby1.8: bad interpreter: No such file or directory

EDIT1:

root@server-pc:/var/www/mysite# which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby

SOLUTION:

log in as non-root user


remove old ruby

remove ruby

sudo apt-get purge ruby rubygems

remove rails

sudo gem uninstall rails

remove old ruby script

cd /usr/bin
sudo rm rails

cd /usr/local/lib
sudo rm -rf ruby
sudo rm -rf site-ruby

remove rvm

rvm implode

install Ruby 1.9.2 & Rails 3

sudo apt-get install git

sudo apt-get install curl

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

nano ~/.bashrc

and add the following line to the end (and save the file)


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Then reload the shell session using this command

source ~/.bashrc

Now you can test whether the RVM has been installed successfully or not

type rvm | head -1

After executing above command you should be getting this output -
rvm is a function

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev 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

rvm install 1.9.2
rvm use 1.9.2
ruby -v

install Rails

gem install rails

That’s All.

Now, create a sample application (just for testing) using Ruby on Rails.

rvmsudo rails new my_app or rails new my_app

cd my_app
sudo bundle install

rvmsudo rails s or rails s

navigate to

http://localhost:3000

See Answers


source: http://stackoverflow.com/questions/9563656/ubuntu-10-ruby-1-9-rails-3-not-working-solved
Programming in ruby or rials – ror: programming-in-ruby-or-rials-ror

Leave a Reply