【问题标题】:issue with capistrano and rake using ext/multistage and rake 0.9.2.2 vs 0.9.2 on the deployed servercapistrano 和 rake 在部署的服务器上使用 ext/multistage 和 rake 0.9.2.2 vs 0.9.2 的问题
【发布时间】:2012-05-11 11:15:21
【问题描述】:

我想在服务器上建立一个登台环境。我目前正在使用 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,我该怎么做?

谢谢

【问题讨论】:

    标签: ruby-on-rails capistrano


    【解决方案1】:

    例如,当您忘记bundle exec rails something 时,通常会出现该错误。 capistrano 是否询问/想要一个捆绑命令来捆绑安装这些 gem?

    编辑: 是的,我敢打赌你的项目不会期待这个:rake RAILS_ENV=production db:migrate 但也许是bundle exec rake RAILS_ENV=production db:migrate

    我不确定你是如何设置上限的。

    这是一个 Rails 3 项目吗?

    【讨论】:

    • 嗯...我会在服务器上运行它吗?看起来问题在于 rake 为 0.9.2 而它想要 0.9.2.2
    • 那个确切的消息通常是bundle在命令中被遗漏的迹象。就像您在需要 bundle exec rails g model.... 的项目上运行 rails g model Blah 一样,您将看到此消息。所以我猜这可能是捆绑的东西,而不是具体的上限。
    • 我认为这是一个 rake 版本问题,但我不确定如何解决。
    猜你喜欢
    • 1970-01-01
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多