Ubuntu 10 Ruby 1.9 Rails 3 not working?

Hi, there is someone who can help me, has been struggling with this for some time. Im running Ubuntu 10 on a dev machine that had a ruby 1.8 , which I deleted . 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] 

which seems right

I created a new test application using

 rails new mysite 

who successfully created a new application then I

 cd mysite 

and created gemset

 rvm gemset create 'rails3' 

then i used this inside / 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 occurs 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 
+4
source share
2 answers

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

+5
source

Well, I believe in this line:

 -bash: /usr/bin/rails: /usr/bin/ruby1.8 

means that you already have the binary / usr / bin / rails, which uses the ruby1.8 interpreter. Try moving it somewhere:

 mv /usr/bin/rails /usr/bin/rails-1.8 

then go to the project directory and bundle install .

If you already have rails in the kit, try reinstalling the gems.

+1
source

Source: https://habr.com/ru/post/1399733/


All Articles