【发布时间】:2012-05-09 11:03:16
【问题描述】:
捆绑器版本 1.0.22
部署到 RedHat Linux 6
Ruby 1.9.3p0
Rails 3.2.1
我阅读了 Bundler 文档并采取了这些步骤...
在开发工作站上设置好所有东西,所以所有的 gem 都安装好了,应用程序可以工作并且测试通过了。
已将
Gemfile和Gemfile.lock签入源代码管理。确保不要将.bundle签入源代码管理。
我跑了$ cap deploy。现在我的代码在生产服务器上。
按照docs 中的说明,我登录,cd 到我的应用程序根目录,然后运行...
$ bundle install --development
这是结果...
$ bundle install --deployment
Fetching source index for https://rubygems.org/
Could not find capistrano-2.11.1 in any of the sources
有人知道为什么会出现这个错误吗?
知道如何说服 Bundler 安装所需的 gem?
我试图从 Bundler 认为的 gem 环境中找到线索...
$ bundle exec gem environment
Could not find rake-0.9.2.2 in any of the sources
我查看了 Bundler 故障排除页面并按照那里的说明删除了一堆东西...
# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/
# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
# remove project-specific settings and git repos
rm -rf .bundle/
# remove project-specific cached .gem files
rm -rf vendor/cache/
# remove the saved resolve of the Gemfile
#
# For now, did not delete this. If I understand the Bundler docs correctly,
# this file is sort of the whole point of Bundler. If I delete it, my deployed
# dependencies won't be the same as in development.
# rm -rf Gemfile.lock
# try to install one more time
bundle install
Bundler 仍然说...
$ bundle install --deployment
Fetching source index for https://rubygems.org/
Could not find capistrano-2.11.1 in any of the sources
好的,好的。我会删除Gemfile.lock...
$ bundle install --deployment
The --deployment flag requires a Gemfile.lock. Please make sure you have checked
your Gemfile.lock into version control before deploying.
如果能提供任何帮助,我将不胜感激。
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 rubygems bundler