Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running "bundle install" fails and asks me to run "bundle install"

In fact, all gem-related commands result in the same error message, when run from inside the existing rails app I cloned from a git repo.

$ bundle install
Could not find tzinfo-0.3.27 in any of the sources
Run `bundle install` to install missing gems.

$ gem list
Could not find tzinfo-0.3.27 in any of the sources
Run `bundle install` to install missing gems.

$ bundle update
Could not find tzinfo-0.3.27 in any of the sources
Run `bundle install` to install missing gems.

$ rails -v
Could not find tzinfo-0.3.27 in any of the sources
Run `bundle install` to install missing gems.

I thought I already had rails installed... (following commands were run from outside the app directory):

$ rails -v
Rails 3.0.3

$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]

Any idea what's up with "bundle install" telling me to run "bundle install"??


I exited my app directory and manually did

sudo gem install tzinfo -v 0.3.27

But upon entering my app directory again and trying "bundle install"...

$ bundle install
Could not find polyglot-0.3.1 in any of the sources
Run `bundle install` to install missing gems.

So I went back out of the app directory, did

sudo gem install polyglot -v 0.3.1

"bundle install" now yielded

$ bundle install
Could not find treetop-1.4.9 in any of the sources
Run `bundle install` to install missing gems.

Why am I having to manually install all these random gems that I didn't have to in the past? (new dev env). Anyone know what I could have set up wrong in my environment?

like image 272
Tim Avatar asked Aug 07 '11 07:08

Tim


People also ask

How do I fix a run bundle to install missing gems?

Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .

What is bundle install?

bundle install is a command we use to install the dependencies specified in your Gemfile.

What is the difference between bundle install and bundle update?

lock . In general, you should use bundle install(1) to install the same exact gems and versions across machines. You would use bundle update to explicitly update the version of a gem.

Why do I need bundle exec?

bundle exec allows us to run an executable script in the specific context of the project's bundle. Upon running the above command, bundle exec will run the executable script for rake version specified in project's Gemfile thus avoiding any conflicts with other versions of rake installed system-wide.


2 Answers

OK guess I fixed it..

For the gems that running bundle install complained about when run from inside the app directory, I installed them by going outside the app directory and doing sudo gem install [gem] one by one. Doing bundle install --gemfile=myApp/Gemfile also installed a couple of the missing gems.

I have no idea why I wasn't able to just run bundle install from inside the app directory...lame.

like image 140
Tim Avatar answered Sep 16 '22 18:09

Tim


I had this problem. Once I did:

[root@smaug ~]# PATH=$PATH:~/.gem/ruby/2.0.0/bin

[root@smaug ~]# export PATH

Then it was fixed and I could just

[root@smaug msf3]# bundle install

successfully.

like image 31
Stiege Avatar answered Sep 19 '22 18:09

Stiege