Bundler throws No Such file or directory for gem i

2019-04-10 06:48发布

问题:

In Gemfile,

gem "backup", :git => "git://github.com/tenmiles/backup.git", :ref => "develop"

n local and in staging, bundle install did finish successfully. In production, when bundle install --deployment happens, bundler throws this error

Using backup (3.0.19) from git://github.com/tenmiles/backup.git (at develop)
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:365:in `initialize': No such file or directory - /home/anand/public_html/myapp/releases/20111113170352/vendor/bundle/ruby/1.9.1/bundler/gems/gems/backup-3.0.19/bin/backup (Errno::ENOENT)

I checked in /home/anand/public_html/myapp/releases/20111113170352/vendor/bundle/ruby/1.9.1/bundler/gems/gems/ and backup-150fb5168ebe is there! Its a gem installed via git. why is bundler looking for backup-3.0.19. How can I refresh backup gem and ask bundler to re install the gem from scratch.

Please help

回答1:

Try this http://raflabs.com/blogs/silence-is-foo/2010/07/19/installing-a-gem-fork-from-github-source/ U can install the gem into your gem set by the method mentioned in there



回答2:

I had this issue with 1.0.10, but when I updated the servers to bundler 1.0.21 the problem went away.



回答3:

i have the some problem with current spork. If you specify a version it should work

gem "backup", '1.0', :git => "git://github.com/tenmiles/backup.git"

it fixed it for me