23

I just installed bundler-1.3.3 successfully. However, when I try to run bundle install I get

Bundler::GemfileNotFound

What is wrong here?

user1420042
  • 1,689
  • 9
  • 35
  • 53

6 Answers6

68

cd into a directory that has a Gemfile

Anna
  • 1,479
  • 12
  • 14
  • 3
    Happened to me because I created a project in a sub directory but tried to run Bundle isntall in the parent. – Sean Dunford Jul 06 '13 at 08:14
  • 1
    Looks like what @SeanDunford experienced is the most common problem. Had also forgotten to cd to the project directory I just created. I cannot believe I had to Google the problem :-) – mydoghasworms Mar 20 '14 at 06:45
  • Haha. Glad it got someone else and I was able to help. I felt dumb but you know, shit happens. – Sean Dunford Mar 20 '14 at 07:12
4

In my experience, this will occur when your code is not executing in the directory you think it is (hence the previous answer), or the directory containing the Gemfile has been moved or deleted.

I experienced this when I had been running unicorn on a server running an app that had been deployed with Capistrano. After cleaning up some old "releases" folders, I got this error when I tried to cap deploy a new release.

Because unicorn had been started with bundle exec, it was still using the Gemfile from the directory it was started in; sending the USR2 signal would tell it to reload the application, but it will still use the old Gemfile before loading the newly-deployed app. Of course, I had deleted that Gemfile when I deleted the old releases.

The solution was to restart unicorn with a new bundle exec in the new directory, to load the new Gemfile and then the new app.

So, the answer above is correct. You just need to figure out why the Gemfile you thought you were using is not being used.

nachbar
  • 2,643
  • 1
  • 24
  • 34
2

Run rubygems-bundler-uninstaller or if command not found run with this gem uninstall rubygems-bundler.

Got solution from here.

Community
  • 1
  • 1
Nizamil Putra
  • 582
  • 1
  • 7
  • 26
2

For those of you that are having this problem when trying to install Redmine, make sure that you are located in your top level Redmine folder. Running gem install bundler will work when run from root. But "bundle install" must be run from your Redmine folder. Once I ran bundle install from the Redmine folder, the "Bundler:GemFileNotFound" error went away.

Remember this is only for those getting this error when trying to install Redmine.

Alison R.
  • 4,204
  • 28
  • 33
1

I reinstalled rubygems-bundler (got 1.4.2) and compass now works even when using rvm (using Ruby 1.9.3)

gem install rubygems-bundler
Mitchell Simoens
  • 2,516
  • 2
  • 20
  • 29
0

Here there is a working script to install Redmine. You can copy the way they do it. It works.

https://manageacloud.com/cookbook/redmine

Tk421
  • 6,196
  • 6
  • 38
  • 47