Bundle Install trying to install gem not in Gemfile - ruby-on-rails

I have a strange problem. I cloned a working rails repository from github.
It had a gemfile with certain gems and "debugger" was not one of them.
However when i ran "bundle install" it error out
An error occurred while installing debugger (1.6.8), and Bundler cannot
continue.
Make sure that `gem install debugger -v '1.6.8'` succeeds before bundling.
So i deleted the Gemlock file which had a reference to the debugger. Now i try to do "bundle install"again. I am getting the same error.
I am using ruby 2.1 and debugger is not compatible with it and everybody seems to be moving byebug. However im not able to move away from debugger as my bundler wont let me.
Any thoughts.

Related

Can't install bundle versions properly

I haven't used Rails since a year ago and I'm very rusty with the process. I've tried cloning it locally, then running bundle install. This is where I run into a suite of errors.
Then I get this error:
An error occurred while installing gemname (version), and Bundler cannot
continue.
Make sure that `gem install gemname -v 'version'` succeeds before bundling.
The surveyor gem last & latest version is 1.4.0 therefore you are getting this error. Check your Gemfile and fix the version in it.
You can refer the gem available version here

Failure to bundle install on Rails

I run into this error while trying to run bundle install.
An error occurred while installing nokogiri (1.6.8.1), and Bundler
cannot continue.
Make sure that gem install nokogiri -v '1.6.8.1' succeeds before bundling.
Could someone help me plse? thanks
It seems to me that this issues is similar to the one discussed in the following link:
Running "bundle install" fails and asks me to run "bundle install"

Ruby -- run a local gem server

I'm a Ruby novice working on a Rails application. We're trying to speed up our installs by running a local gem server instead of always going out to rubygems.org. I found that running the command:
gem server
sets this up, with the server running at localhost 8808. However when I add a source line for that URL to my Gemfile, and then run "bundle install", it fails after a minute or so saying:
Gem::RemoteFetcher::FetchError: bad response Not Found 404 (http://localhost:8808/gems/rake-10.3.1.gem)
An error occurred while installing rake (10.3.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.3.1'` succeeds before bundling.
If I browse to that server, I see a page saying that Rake, version 10.3.1 is installed, but when I go to the listed URL, I do get a 404 page. After running the gem install command, I still get a 404 page, but the bundle install gets a step further and fails with:
Gem::RemoteFetcher::FetchError: bad response Not Found 404 (http://localhost:8808/gems/activesupport-3.2.12.gem)
An error occurred while installing activesupport (3.2.12), and Bundler cannot continue.
Make sure that `gem install activesupport -v '3.2.12'` succeeds before bundling.
What's going on here? I have both source lines in my Gemfile, so I'd expect the bundler to go out to rubygems.org for anything it couldn't find locally, but it also seems like the gems are in fact installed locally already. Do I have to run individual installs on each gem dependency? I'm sure I'm doing something obviously wrong here, but I'm don't know what it is.
This is a decent walkthrough of a few situations you might encounter while setting up a gem server: http://guides.rubygems.org/run-your-own-gem-server/
This one isn't half-bad either, if you're looking to just use local versions of gems (though this technique doesn't set up a separate gem server): https://coderwall.com/p/tqdrhq

Bundle install throwing error

I am getting the following error when I try to run bundle install
Bundler::GemspecError: Could not read gem at /usr/local/rvm/gems/ruby-1.9.3-p484#rails3tutorial/cache/turbolinks-2.1.0.gem. It may be corrupted.
An error occurred while installing turbolinks (2.1.0), and Bundler cannot continue.
Make sure that `gem install turbolinks -v '2.1.0'` succeeds before bundling.
Even if in install the above said gem and rub bundle install it throws a similar error and asks me to make sure an another gem is installed and this goes on and on.
I am using Rails 4.0.2 and ruby 1.9.3p484.
Maybe the file cache got corrupted. Try:
bundle install --no-cache
If this does not work, delete the cache directory and try again:
rm -rf /usr/local/rvm/gems/ruby-1.9.3-p484#rails3tutorial/cache
bundle install
I just had this problem with the bcrypt gem
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Bundler::GemspecError: Could not read gem at /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem. It may be
corrupted.
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.
The /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem file was 0 bytes; removing this file or using the --no-cache option didn't help.
Using gem install bcrypt -v '3.1.7' did work, so I copied ~/.gem/ruby/2.1.0/cache/bcrypt-3.1.7.gem to /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem and that allowed me to continue. You could also fetch the .gem file from http://rubygems.org if you can't find it on your system.
I suspect there's some sort of connection issue with bundler (but not with gem for some reason); I suspect DNS since there's an unusual long wait before I get an error, but didn't investigate further.

bundle install request to do each gem install manually - how to avoid?

This is probably very simple question.
Each time I do "Bundle install" in the folder of the project
I get an error like this
An error occured while installing json (1.6.6), and Bundler cannot continue.
Make sure that X succeeds before bundling.
where X can be
'gem install json -v '1.6.6'
or
'gem install execjs -v '1.3.2'
or
'gem install coffee-script -v '2.2.0'
Now, after I gradualy do each gem install manually the bundle install succeeds.
Is there a way to do them all in one command?
is there a way to do it in ruby mine?
That's what Bundler is supposed to do for you.
It looks like you have a problem with your Bundler or Ruby Install somewhere.
Without more information I can only suggest that you checkout the Bundler Troubleshooting page.
I've run into the same problem before if my network connection was an unstable/low bandwidth wireless connection. It tries to install all the gems at once, but stalls on one of them because of the lack of bandwidth. Then you can of course install one at a time maybe, but if your connection keeps going in and out this may be the cause of your inability to install them all at once.
It's possible that some of your gems aren't getting installed due to a bug related to using SSL connections. This would then mean that gems that depend on those gems throw an error like the one you experienced.
See: http://railsapps.github.com/openssl-certificate-verify-failed.html
That link has various workarounds, but the easiest is to replace this line:
source 'https://rubygems.org'
at the top of your Gemfile with this line:
source 'http://rubygems.org'

Resources