我想在服务器上建立一个登台环境。我目前正在使用 capistrano 进行部署。
我对 ext/multistage 扩展进行了更改,但出现以下错误:
# Add RVM's lib directory to the load path.
* executing "cd /data/sites/staging.domain.com/apps/app/releases/20120501225426 && rake RAILS_ENV=production db:migrate"
servers: ["173.111.158.135"]
[173.111.158.135] executing command
*** [err :: 173.111.158.135] rake aborted!
*** [err :: 173.111.158.135] Could not find rake-0.9.2.2 in any of the sources
*** [err :: 173.111.158.135]
*** [err :: 173.111.158.135] (See full trace by running task with --trace)
*** [err :: 173.111.158.135]
command finished in 1332ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '1.9.2' -c 'cd /data/sites/staging.domain.com/apps/app/releases/20120501225426 && rake RAILS_ENV=production db:migrate'" on 173.111.158.135
在我的 gemfile 中,我有:
gem 'rake', '0.9.2.2'
在我的本地机器上,我得到:
Tue May 01$ rake -V
rake, version 0.9.2.2
Tue May 01$
在服务器上,我有:
#rake -V
rake, version 0.9.2
#rake
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.
如果我运行以下命令:
# which ruby
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
# which rake
/usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake
# /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake -V
rake, version 0.9.2
上限错误似乎有点神秘。谁能帮我解决这个问题?如果我指定了 0.9.2.2 并且它只有 9.2,为什么我的其他 cap 脚本会起作用?有没有一种方法可以强制 capistrano 安装我目前没有安装的 rake 0.9.2.2,我该怎么做?
谢谢