开发者

Rake cannot find gems in vendor/gems

开发者 https://www.devze.com 2023-04-05 01:35 出处:网络
I\'m trying to publish a Rails 3.1 (upgraded from 3.0) application. After submitting the code I ran bundle install --path vendor/gems RAILS_ENV=production

I'm trying to publish a Rails 3.1 (upgraded from 3.0) application. After submitting the code I ran

bundle install --path vendor/gems RAILS_ENV=production

It worked. I've got a directory vendor/gems/ruby/1.9.1, in which bin, cache, doc, gems and specifications are located. However, when I run a rake task I've got an error:

$ rake db:migrate RAILS_ENV=production
Could not find authlogic-3.0.3 in any of the sources
Run `bundle install` to install missing gems.

It's not a problem with authlogic, it's both in gems and specifications directories, and it was annotate mentioned in the error before I removed it from the gemfile.

What can be wrong?

I'开发者_开发技巧m using Ubuntu 10.10, Ruby 1.9.2p0, Rails 3.1 and Rake 0.9.2. The code was deployed by capistrano, vendor directory is placed in shared folder and linked in the releases.


If you want to use the project's gems then you should use bundle exec command e.g.,

bundle exec rake db:create

also require authlogic gem in gem file.

gem 'authlogic'

First delete the whole gems directory from vendor/ folder. You should use this:

bundle install --path=vendor/gems

no needs for specifying the environment.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号