【问题标题】:Capistrano deploy fails due to ruby messages由于 ruby​​ 消息,Capistrano 部署失败
【发布时间】:2016-02-16 20:25:45
【问题描述】:

我正在尝试使用 capistrano 3.4.0 和 capistrano-rails 1.1.6 部署我的应用程序,但似乎在资产清单期间,当复制 .sprockets-manifest.json 的命令运行时,不知何故 ruby​​ 消息与突击队并导致部署失败。

以前发生过这种情况,我可以通过将 sprockets gem 降级到 2.8 版本来修复它,但是在此我使用的是 rails 4.2.4,它需要至少 3 的 sprockets 版本。

下面是命令和输出,如果你能帮助我,我会很高兴。

提前致谢

INFO [19795580] Running /usr/bin/env cp RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,  you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.  To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.    /var/www/apps/meetings/releases/20160216200613/public/assets/.sprockets-manifest-5435a7146eb18edb8a835b87bffff57b.json /var/www/apps/meetings/releases/20160216200613/assets_manifest_backup as user@server
DEBUG [19795580] Command: cd /var/www/apps/meetings/releases/20160216200613 && /usr/bin/env cp RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,  you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.  To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.    /var/www/apps/meetings/releases/20160216200613/public/assets/.sprockets-manifest-5435a7146eb18edb8a835b87bffff57b.json /var/www/apps/meetings/releases/20160216200613/assets_manifest_backup
DEBUG [19795580]    RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

DEBUG [19795580]    cp: cannot stat ‘RVM’: No such file or directory
cp: cannot stat ‘used’: No such file or directory
cp: cannot stat ‘your’: No such file or directory
cp: cannot stat ‘for’: No such file or directory
cp: cannot stat ‘selecting’: No such file or directory
cp: cannot stat ‘Ruby,’: No such file or directory
cp: cannot stat ‘it’: No such file or directory
cp: cannot stat ‘is’: No such file or directory
cp: cannot stat ‘all’: No such file or directory
cp: cannot stat ‘fine’: No such file or directory
cp: cannot stat ‘-’: No such file or directory
cp: cannot stat ‘Heroku’: No such file or directory
cp: cannot stat ‘does’: No such file or directory
cp: cannot stat ‘that’: No such file or directory
...
...

【问题讨论】:

    标签: ruby-on-rails ruby deployment capistrano sprockets


    【解决方案1】:

    好的。问题是因为 rvm 覆盖 cd 命令以提供有关 Gemfile 中的 ruby​​ 版本控制的一些信息,并且当 capistrano-rails 运行清单备份任务时,它运行 cd 命令以获取应用程序项目文件夹和 rvm 信息也正在返回,结果 deploy 引发了错误。

    要解决这个问题,要么

    rvm rvmrc warning ignore allGemfiles
    

    可以运行并且可以在服务器范围内禁用 rvm 消息,或者您可以在项目的根路径中创建一个名为 .ruby-version 的文件并在其中设置 ruby​​ 版本。例如:

    2.2.4
    

    据我了解 .ruby-version 用于 rbenv 但不知何故它也禁用了 rvm 消息。

    希望它也对其他人有所帮助

    【讨论】:

      【解决方案2】:

      Rails 4+ 对某些 gem 的特定版本非常挑剔。尝试将您的 gemfile 更新为以下内容:

      group :development, :test do
        gem 'capistrano', '~> 3.4.0'
        gem 'capistrano-rvm'
        gem 'capistrano-bundler', '~> 1.1.2'
        gem 'capistrano-rails', '~> 1.1'
        gem 'capistrano-passenger'
      end
      

      【讨论】:

      • 感谢您的留言,我正在使用最新版本的 capistrano gems,但仍然无法正常工作
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多