0
我想从Windows开发机器部署Rails应用程序到使用Capistrano,Passenger和RVM的Debian 9 VPS。我在Windows机器上安装了VPS和Capistrano上的Apache和RVM和Passenger。然而,当我尝试运行cap production deploy
,我得到以下错误:Capistrano:bundler:未能加载命令:耙
bundler: failed to load command: rake (/var/www/APPNAME/shared/bundle/ruby/2.4.0/bin/rake)
一个开发在Windows上的怪癖是,Gemfile.lock
必须在部署编辑删除宝石Windows的特定版本。我写了一个自定义任务来执行此操作,该操作似乎按预期运行。
这里有一些文件可能是有用的:
- log/capistrano.log, starting with the custom task
- Gemfile
- Gemfile.lock
- Capfile
- config/deploy.rb
- config/deploy/production.rb
- lib/capistrano/tasks/dewindowsify.rake (the custom task)
你检查过VPS上是否存在'/ var/www/APPNAME/shared/bundle/ruby/2.4.0/bin/rake'?并且是您的rvm组中的capistrano ssh用户?在尝试调用ruby脚本之前,您的capistrano是否设置了源代码的rvm环境? –
我检查并存在该文件。 VPS上没有称为“rvm”的组; rvm被安装到ssh用户的主目录中。我使用capistrano-rvm gem,而source命令位于ssh用户的bashrc中,所以我认为环境正在加载。 –
我建议测试这个假设,rvm非常脆弱。 –