Capistrano捆绑安装宝石从git rails找不到宝石?

时间:2012-02-14 20:51:16

标签: ruby-on-rails-3.1 capistrano bundler

分叉wicked_pdf并添加到Gemfile

gem 'wicked_pdf', '= 0.7.2', :git => 'git://github.com/geoffcorey/wicked_pdf.git'

Capistrano部署

bundle install --path vendor/gems --without development

所有宝石都显示在vendor/gems/ruby/1.9.1/gems中,除了wicked_pdf,将repo克隆到vendor/gems/ruby/1.9.1/bundler/gems

bundle list将显示wicked_pdf (0.7.2 156782e)但是当我通过Apache / Passenger启动应用程序时,Rails 3.1.3找不到wicked_pdf。

作为部署的一部分,我应该做些什么来让wicked_pdf构建gem并作为单独的任务安装?

2 个答案:

答案 0 :(得分:0)

我在这里遇到了完全相同的问题(但是在heroku上托管)。 http://gembundler.com/man/bundle-package.1.html “在Bundler 1.0中,bundle package命令只打包.gem文件,而不是使用:git或:path选项指定的gems。这可能在将来发生变化。”

看看: Bundler: `bundle package` with a :git source

也许可以使用: http://underpantsgnome.com/2011/01/05/how-to-install-private-gems-on-heroku 安装宝石。

答案 1 :(得分:0)

您的问题可能是(a)您将其锁定到精确版本“= 0.7.2”,但您没有在git repo上指定提交ID。这两件事情是冲突的。 gemspec中的版本条目可能不再是你从git中提取的分支的尖端0.7.2。

如果为gem指定git位置,最好不要指定版本,而是指定所需的提交ID,即:

gem 'wicked_pdf', :git => 'git://github.com/geoffcorey/wicked_pdf.git', :ref => 'commit_id_on_github_you_want'
相关问题