我在添加名为private_pub
的gem之后尝试将我的应用部署到服务器它在本地运行顺利。但是当我使用capistrano部署时,无法在终端上部署出现的错误代码。
DEBUG [56a34683] rake aborted!
DEBUG [56a34683] ArgumentError: The staging environment does not exist in /var/www/vendorpedia/releases/20170729083837/config/private_pub.yml
DEBUG [56a34683] /var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/private_pub-1.0.3/lib/private_pub.rb:22:in `load_config'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/private_pub-1.0.3/lib/private_pub/engine.rb:8:in `block in <class:Engine>'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
在上一条错误消息中:
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as root@188.166.221.138: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
ArgumentError: The staging environment does not exist in /var/www/vendorpedia/releases/20170729083837/config/private_pub.yml
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/private_pub-1.0.3/lib/private_pub.rb:22:in `load_config'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/private_pub-1.0.3/lib/private_pub/engine.rb:8:in `block in <class:Engine>'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
/var/www/vendorpedia/shared/bundle/ruby/2.3.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
/var/www/vendorpedia/releases/20170729083837/config/environment.rb:5:in `<top (required)>'
我该怎么办?真的需要你的帮助!
谢谢!
答案 0 :(得分:0)
您可以使用此代码 ssh_options [:keys] =%w(&#39;〜/ .ssh / id_rsa.pub&#39;)
而不是 ssh_options [:keys] =%w(〜/ .ssh / id_rsa.pub)