ruby on rails gem file installation install bundle - ruby-on-rails

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.

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.

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.

Related

Rack 2.0.1 requires Ruby >= 2.2.2

I am trying to run "bundle update", but I keep getting the error message:
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that `gem install rack -v '2.0.1'` succeeds before bundling.
Then I install rack 2.0.1:
sudo gem install rack -v 2.0.1
Successfully installed rack-2.0.1
Parsing documentation for rack-2.0.1
Done installing documentation for rack after 2 seconds
1 gem installed
Then I even ran "rbenv rehash", and I run "bundle update" again and the same error message shows up. How do I get Bundler to recognize the new gem?
Make sure you have the "bundler" installed from the ruby version installed by rbenv first. Then, check the ruby version in that directory. It should be the one that you installed from rbenv or rvm. After these, if you are installing something just don't use sudo before bundle. Because bundle is from the rbenv ruby version. If the rbenv rehash doesn't work, just restart the bash and check.
If the without sudo thing needs permission, you are most likely using the bundler that was installed by your system ruby as sudo gem install bundler.
Try reinstalling bundler without a sudo like gem install bundler and retry.
Even if that doesn't work, remove the Gemfile.lock in your directory. Remove any version of rack mentioned in your Gemfile if any. Just have the gem name like gem 'rack' and try bundle install again. The gem that you could install with sudo was stored for the system ruby, not the one you have installed through rbenv.
When you ran sudo install, your gem most probably got installed under a different directory. When using Rbenv or VRM, you shouldn't use sudo.
First of all you could try uninstalling the gem from your system gems and doing it again without sudo.
Going into extremes you could completely reinstall your rbenv with gems (and while at it switch to RVM, personally I think its easier to manage). After that try to bundle install everything again without sudo and it should work.

rake doesn't work, missing gem

My rake function don't work anymore
$rake routes
Could not find sass-rails-4.0.1 in any of the sources
Run `bundle install` to install missing gems.
when i run bundle install, it says:
Errno::EACCES: Permission denied - /Users/kaibakker/dewortel/vendor/bundle/bin/ri
An error occurred while installing rdoc (3.12.2), and Bundler cannot continue.
Make sure that `gem install rdoc -v '3.12.2'` succeeds before bundling.
sudo bundle install works fine
I already un- and reinstalled gem sass
Its probably a simple problem (i am new to rails)
Thanks in advance
System (OSX 10.7, rails 4.0.1, ruby 2.0.0)
Seems like I fixed it, pretty simple solution after all:
move vender/bundle to the trash and run bundle install.

bundle fails with rake error on vagrant

I've been following the railscast on setting up Vagrant with rails found here:
http://railscasts.com/episodes/292-virtual-machines-with-vagrant
I have rbenv running on vagrant with a slightly more updated version of ruby(1.9.3p125). Everything goes fine until I try to bundle. Here's the error I get:
vagrant#lucid32:/vagrant$ bundle
Fetching gem metadata from http:rubygems...
Fetching gem metadata from http:rubygems...
Resolving dependencies...
Using rake (10.0.3)
Errno::EPROTO: Protocol error - /vagrant/bin
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that gem install rake -v '10.0.3' succeeds before bundling.
I've tried gem installing that version of rake, then running rbenv rehash which seems to install, but running bundle again still gives me the same error.
I was able to resolve this by downgrading bundler from 1.3.2 to 1.2.5.
rvm use #global
gem uninstall bundler
gem install bundler -v 1.2.5
# switch back to the default gemset
rvm use
bundle install
# everything should work now
The only other thing that I changed was I reverted from rvm 1.18.19 to 1.17.10, but I am not positive that step is necessary.

aws-s3 gem install error- bittorrent.rb

Am running build install on an existing project and I get this error:
Installing aws-s3 (0.6.2)
Errno::EACCES: Permission-denied -
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.2/lib/aws/s3/bittorrent.rb
An error occured while installing aws-s3 (0.6.2) and Bundler cannot
continue, make sure that gem install aws-s3 -v '0.6.2' succeeds before
bundling.
I get the same error if I just run "gem install aws-s3 -v '0.6.2'"
Doing this on Windows 7, and I am making sure to run the prompt as
administrator.
Any ideas how to get past this?
Try following:
In your Gemfile or wherever you have specified the gems list and replace source 'https' with this source 'http' otherwise it will keep on asking Make sure that gem install xxx -v 'xxx'' succeeds before bundling.
Do bundle install or rails new todo

I'm having trouble running my Rails web server

I have installed ruby193 and I've installed rails via the command prompt (I also installed a DevKit). However, whenever I try the command:
rails server
I get this error:
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m
I've tried a bundle install and it gives me an error with when trying to install the json gem. Any suggestions?
make sure in your Gemfile you are including the right gem (no misspellings, etc)
Looks like you are on Windows.
I defeated the very same problem on Windows by manually installing my gems from Gemfile (gem install gem_to_install). After successfully installing a particular gem I ran bundle check to see what else I need to install. And this way after few installed gems I ran bundle check again and saw the output The Gemfile's dependencies are satisfied.
And then server started. I wish you the same!
P.S. You can install few gems at once: gem install gem1 gem2.

Resources