Ruby on rails 使用capistrano部署“authority”gem时出错

Ruby on rails 使用capistrano部署“authority”gem时出错,ruby-on-rails,deployment,capistrano,authority-gem,Ruby On Rails,Deployment,Capistrano,Authority Gem,我正在将rails4应用程序从开发人员计算机部署到服务器。这项部署工作进展顺利 我已使用添加授权到我的应用程序中。当我运行./bin/cap deploy时,我现在在下面列出的unicorn日志中得到了错误 在dev机器上使用railsgauthority:install创建的所有文件都已提交给git,并正在使用/bin/cap deploy部署到服务器 谢谢你的帮助 I, [2013-10-08T14:06:42.579240 #2021] INFO -- : worker=0 spawni

我正在将rails4应用程序从开发人员计算机部署到服务器。这项部署工作进展顺利

我已使用添加授权到我的应用程序中。当我运行./bin/cap deploy时,我现在在下面列出的unicorn日志中得到了错误

在dev机器上使用
railsgauthority:install
创建的所有文件都已提交给git,并正在使用
/bin/cap deploy
部署到服务器

谢谢你的帮助

I, [2013-10-08T14:06:42.579240 #2021]  INFO -- : worker=0 spawning...
I, [2013-10-08T14:06:42.583257 #3594]  INFO -- : worker=0 spawned pid=3594
I, [2013-10-08T14:06:42.583904 #3594]  INFO -- : Refreshing Gem list
E, [2013-10-08T14:06:42.743225 #3588] ERROR -- : uninitialized constant Authority (NameError)
/home/deployer/apps/app-name/releases/20131008015646/config/initializers/authority.rb:1:in `<top (required)>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in `each'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in `block in <class:Engine>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:in `each'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/deployer/apps/app-name/releases/20131008015646/config/environment.rb:5:in `<top (required)>'
config.ru:4:in `require'
config.ru:4:in `block in <main>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `eval'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `block in builder'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `call'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `build_app!'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:595:in `init_worker_process'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:615:in `worker_loop'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:511:in `maintain_worker_count'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:277:in `join'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn:126:in `<top (required)>'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
/home/deployer/apps/app-name/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'
E, [2013-10-08T14:06:42.758457 #2021] ERROR -- : reaped #<Process::Status: pid 3588 exit 1> worker=1
I[2013-10-08T14:06:42.579240#2021]信息--:worker=0产卵。。。
一、 [2013-10-08T14:06:42.5832573594]信息--:工人=0衍生pid=3594
一、 [2013-10-08T14:06:42.5839043594]信息--:刷新宝石列表
E、 [2013-10-08T14:06:42.7432253588]错误--:未初始化的常量权限(NameError)
/home/deployer/apps/app name/releases/20131008015646/config/initializers/authority.rb:1:in`'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:609:in“block(2层)in”
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in'each'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in'block-in'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in'instance_exec'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in'run'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:“运行中的块初始化器”
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:150:in'block in tsort_each'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:183:在每个强连接的组件中的“块(2个级别)”中
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:210:在每个强连接的组件中的“块(2个级别)”中
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:219:在“每个强连接的组件”中
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:209:在“每个强连接的组件中的块”中
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in'each'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in'tsort_each_child'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:203:在“每个强连接的组件”中
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:182:在“每个强连接的\u组件中的块”中
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:in'each'
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:“每个强连接的组件”
/home/deployer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/tsort.rb:148:in'tsort_each'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in'run_initializers'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in'initialize!'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in'method_missing'
/home/deployer/apps/app name/releases/20131008015646/config/environment.rb:5:in`'
config.ru:4:in'require'
config.ru:4:in'block in'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in'instance_eval'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in'initialize'
config.ru:1:in'new'
config.ru:1:in`'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in'eval'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in'block in builder'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in'call'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in'build_app!'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:595:in`init_worker_process'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:615:in'worker_loop'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in'spawn_missing_workers'
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:511:在“维护工作人员计数”中
/home/deployer/apps/app name/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:277:in'join'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn:126:in`'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/bin/unicorn:23:in'load'
/home/deployer/apps/appname/shared/bundle/ruby/2.0.0/bin/unicorn:23:in`'
E、 [2013-10-08T14:06:42.758457#2021]错误--:收获#工人=1

最后,我清除了我的生产环境,在我的开发环境中没有做任何更改,并重新运行了cap部署,它成功了。不确定这是什么原因,但没有理由保持打开状态。

您是否将捆绑安装作为部署的一部分?是的。执行捆绑包安装,gem(authority-2.7.0)出现在/home/deployerapps/app name/shared/bundle/ruby/2.0.0/gems目录中。使用
bundle exec rails g运行它authority:install
或检查您的虚拟ruby安装(如果您有虚拟ruby安装)在任何情况下,为什么要在生产机器上运行它?该命令应该在开发环境中执行吗?cap deploy命令正在dev机器上运行。上述输出来自生产机器。