1

I am new with ruby on rails. I have successfully installed ruby on rails 4.2 on Ubuntu 14.04 and created a new app, but when I started the server to see if it is working by writing:

rails server

I get this error message:

Could not find gem 'sass-rails (~> 5.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.

And when I start to install bundle I get other packages that need to be installed before bundle.

Error message for bundle install

   Gem::RemoteFetcher::FetchError: Errno::EHOSTUNREACH: No route to host - connect(2) for "rubygems.global.ssl.fastly.net" port 443 (https://rubygems.org/gems/minitest-5.5.1.gem)
    An error occurred while installing minitest (5.5.1), and Bundler cannot
    continue.
    Make sure that `gem install minitest -v '5.5.1'` succeeds before bundling.

then after I installed minitest and run bundle install

I got this error message

Gem::RemoteFetcher::FetchError: Errno::EHOSTUNREACH: No route to host - connect(2) for "rubygems.global.ssl.fastly.net" port 443 (https://rubygems.org/gems/debug_inspector-0.0.2.gem)
    An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
    continue.
    Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
    bundling.

It keeps showing me packages that I need to install before bundle.

Bono
  • 4,757
  • 6
  • 48
  • 77
user3266023
  • 123
  • 4
  • 15
  • Maybe, you can try a "bundle update" – John Mar 06 '15 at 13:42
  • I would try to see if you can access the endpoint manually (https://rubygems.org/gems/). It appears that there is a connectivity issue or DNS issue that is not allowing you to download the gems. The good news is that you're not crazy and this is most likely nothing to do with you, but a configuration setting in Ubuntu or your router (or your ISP). – kobaltz Mar 06 '15 at 13:52

2 Answers2

0

I'm not on Ubuntu, but I find with Rails 4+ this step-wise gem install is the rule rather than the exception. It doesn't seem to handle dependency gem installs very well with bundle. For each of the "missing" dependency gems, run the single gem install, and then the bundle again to see what's next It may reveal another dependency with each step, just install that. (The caveat is if you're seeing the same gems show up as not being installed on every bundle exec, then that's another problem altogether. Once you single-install the gem it should be locked in and available)

$gem install bundle
$gem install name-of-flagged-gem
$gem install bundle
$gem install next-missing-gem

Hope this helps.

Elvn
  • 3,021
  • 1
  • 14
  • 27
0

Your solution should be right here: SSL Error I had the same exact problem. Each time I did a "bundle install" it told me to make sure "gem install .... succeeds before bundling" And when I did what it said, it just told me about another gem.

Community
  • 1
  • 1
John Pankowicz
  • 4,203
  • 2
  • 29
  • 47