我正在尝试发布Rails 3.1(从3.0升级)应用程序。提交代码后我跑了
bundle install --path vendor/gems RAILS_ENV=production
有效。我有一个目录vendor/gems/ruby/1.9.1
,其中bin
,cache
,doc
,gems
和specifications
位于其中。但是,当我运行rake任务时,我遇到了一个错误:
$ 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.
这不是authlogic
的问题,它位于gems
和specifications
目录中,并且在我从gemfile中删除之前错误中提到了annotate
。
有什么不对?
我正在使用Ubuntu 10.10,Ruby 1.9.2p0,Rails 3.1和Rake 0.9.2。代码由capistrano部署,vendor
目录放在shared
文件夹中,并在版本中链接。
答案 0 :(得分:2)
如果你想使用项目的宝石,你应该使用bundle exec
命令,例如,
bundle exec rake db:create
还需要gem文件中的authlogic gem。
gem 'authlogic'
首先从vendor /文件夹中删除整个gems目录。你应该用这个:
bundle install --path=vendor/gems
无需指定环境。