3
votes

When I run

rails new project

to make new project in Ruby on rails on my PC.

It works fine. Then I run bundle install and it throws this error:

create  vendor/assets/stylesheets/.keep  
run  bundle install 

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.

Fetching source index from https://rubygems.org/

Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from https:// rubygems.org/

Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from https:// rubygems.org/

When I try run my project it throws this error:

c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/resolver.rb:352:in `resolve': Could not find gem 'rails (= 4.1.1) x86-mingw32' in the gems available on this machine. (Bundler::GemNotFound)

Can somebody help me?

4
Have you tried installing the rails gem using gem install rails?Richard Peck
I installed RailsInstaller 2.2.3 on my PC with windows 8.1 I check PS C:\> gem install rails ERROR: Could not find a valid gem 'rails' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ETIMEDOUT: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) (rubygems.org latest_specs.4.8.gz)user3841611

4 Answers

3
votes

Are you using rails 4? check your Gemfile and replace

 source 'http://rubygems.org'

to

source 'https://rubygems.org'
1
votes

Try reboot your machine , mainly if you are working with vagrant, or also if you have any firewall. They may could have a block thread

0
votes

You should update your bundler. You are using 1.6.2 and there is a bugfix for the sudo warning in 1.6.3.

https://github.com/bundler/bundler/issues/2984

https://github.com/bundler/bundler/commit/2cc46c7dd95988659fdb00b9aa00a73295caf130

-1
votes

My solution for this problem was search and replace https for http protocol on all Gemfile on folder c:/RailsInstaller/

search for: "source 'https://rubygems.org'"

replace for: "source 'http://rubygems.org'"

Hope this help. :)