What can I do about a Bundler::GemfileNotFound error?

寵の児 提交于 2019-12-03 11:45:01

问题


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

Bundler::GemfileNotFound

What is wrong here?


回答1:


cd into a directory that has a Gemfile




回答2:


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.




回答3:


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.




回答4:


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

Got solution from here.




回答5:


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



回答6:


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

https://manageacloud.com/cookbook/redmine



来源:https://stackoverflow.com/questions/15393462/what-can-i-do-about-a-bundlergemfilenotfound-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!