我已经使用Rails几个月了,并制作了一个小型应用程序,我试图与Capistrano一起部署。问题是我跑的时候
$ cap production deploy
部署似乎正常运行,但以下3个错误除外:
DEBUG [764d7f01] Running /usr/bin/env [ -L /var/www/rally_app/releases/20150513103829/public/assets ] as deploy@255.255.255.255
DEBUG [764d7f01] Command: [ -L /var/www/rally_app/releases/20150513103829/public/assets ]
DEBUG [764d7f01] Finished in 3.347 seconds with exit status 1 (failed).
DEBUG [929898d3] Running /usr/bin/env [ -d /var/www/rally_app/releases/20150513103829/public/assets ] as deploy@255.255.255.255
DEBUG [929898d3] Command: [ -d /var/www/rally_app/releases/20150513103829/public/assets ]
DEBUG [929898d3] Finished in 4.065 seconds with exit status 1 (failed).
DEBUG [8917ed02] Running /usr/bin/env ls /var/www/rally_app/releases/20150513103829/public/assets/.sprockets-manifest* as deploy@255.255.255.255
DEBUG [8917ed02] Command: cd /var/www/rally_app/releases/20150513103829 && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env ls /var/www/rally_app/releases/20150513103829/public/assets/.sprockets-manifest* )
DEBUG [8917ed02] ls: cannot access /var/www/rally_app/releases/20150513103829/public/assets/.sprockets-manifest*: No such file or directory
DEBUG [8917ed02] Finished in 3.716 seconds with exit status 2 (failed).
此外,Bundler似乎无法正常运行,因为即使App应该在生产中使用PostgreSQL,Passenger会提供有关sqlite3的错误说明:
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
/var/www/rally_app/shared/bundle/ruby/2.2.0/gems/activerecord
我已暂时将RailsEnv更改为开发以查看这些日志。如果它有助于从Phusion Passenger日志发布更多信息,我很乐意发布。请告诉我。
我是Linux服务器管理员,但我是一个完整的Rails / Passenger / rbenv / Capistrano noob,所以请在回复中考虑这一点。 :)
提前感谢您的帮助。
亚历
答案 0 :(得分:0)
我通过查看deploy.rb并取消注释
来解决这个问题set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
我认为缺少第二行是造成错误的原因。我还在我的服务器上手动创建了上面两个yaml文件。
我现在从有关PostgreSQL的rails中收到错误,但由于这是一个更高级别的问题,因此我的问题已经解决了。感谢指点@wpp。