Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Following this tutorial here, to install ruby on rails on ubuntu 11.10 with sqlite3

when I run the following command

sudo gem install rails

I get the following error :

ERROR: Could not find a valid gem 'rails' (>= 0) in any repository

Also, when I try the command,

sudo gem install sqlite3

I get the same error

ERROR: Could not find a valid gem 'sqlite3' (>= 0) in any repository

How do I resolve this?

share|improve this question
add comment

2 Answers

Rails is not available for Ruby 1.9.1 - so if you remove Ruby 1.9.1, you can choose: either you use RVM to install Ruby 1.9.2 or you install Ruby 1.8 and you should be able to install Rails (however, using a older version of Ruby == older version of Rails afaik) :)

(I'm using RVM, which I like as it gives me the opportunity to switch between different installations of Ruby and also develop without having to be root - however I would read more about how RVM works before using it on a production server)

share|improve this answer
    
Oh, sorry, noticed you're not using apt-get to install Ruby. However, try downgrading to 1.9.2 anyways that is tested to work with Rails or try compiling Rails yourself (rubyonrails.org/download) –  sakjur Jan 31 '12 at 19:03
    
My ruby version (from ruby -v) is 1.9.3p0 and my gem version (from gem -v) is 1.8.15 .. rubyonrails.org says that rails 3.2 is recommended for ruby 1.9.3 .. I have the right versions (from what I've read) .. Can you give me the steps for the RVM installation how I can switch versions? –  badZoke Feb 1 '12 at 6:40
    
The site I linked (the-tech-tutorial.com/?p=1868) is quite good (I'm quite sure I used it) - replace 1.9.2 with 1.9.3 and see if that work, however your error seems to have something to do with something else! I'll try to help you look for a solution w/ Rails 3.2 and Ruby 1.9.3 –  sakjur Feb 1 '12 at 9:27
add comment

I have fixed this issue using the proxy command option of gem install. It has the following format:

$ gem install --http-proxy http://201.187.107.19:8080 rails

Check the following answer for more details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.