【发布时间】:2014-06-23 06:36:41
【问题描述】:
上下文是一个试运行,首先测试开发中的资产部署,然后再投入生产。
取消注释以下 capfile 中的行
load 'deploy'
# load 'deploy/assets'
load 'config/deploy'
生成回滚,因为 capistrano 进程正在创建清单文件
bundle exec rake RAILS_ENV=development RAILS_GROUPS=assets assets:precompile && cp -- /Users/stageUser/v4/shared/assets/manifest.yml /Users/stageUser/v4/releases/20140623054425/assets_manifest.yml"
遇到错误
** [out :: ip] rake aborted!
** [out :: ip] FATAL: role "localhostUser" does not exist
** [out :: ip] /Users/stageUser/v4/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
** [out :: ip] /Users/stageUser/v4/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
** [out :: ip] /Users/stageUser/v4/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'
** [out :: ip] /Users/stageUser/v4/shared/bundle/ruby/1.9.1/
localhostUser 不会在登台服务器上的任何位置、deploy.rb 或 Capfile 中调用。它仅定义用于本地主机上的开发和测试数据库使用。该错误显然是通过 postgresql_adapter.rb 发生的
更新怪事。关闭错误参考状态:
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3@v4'
ruby 版本 1.9.3 ... 与 ruby 的捆绑路径在 1.9.1 ... 嗯。这可能有关系吗? 结束更新
部署/资产调用的 postgresql_adapter 是什么。唯一的线索是可以作为数据库初始化程序读取的 manifests.yml 文件...该行确实调用了 'connection_parameters' 但是为什么当 stageServer 不知道它时它使用 localhostUser 呢?
database.yml 用户名在 localhost 和登台服务器之间的定义不同,但我无法理解为什么这会影响 capfile。
如何确保角色设置正确?
【问题讨论】:
标签: postgresql ruby-on-rails-3.2 capistrano asset-pipeline