Capistrano部署:感冒不起作用 [英] Capistrano deploy:cold doesn't work
问题描述
- 为什么我必须输入10次我的运行上限的密码:cold
-
当我尝试通过教学代码设计一个capistrano和
与一些帮助的stackoverflow。我坐下来,有很多教程部署capistrano并写我自己的新版本的deploy.rb
我们的gem env输出看起来如此
RubyGems环境: / p>
- RUBYGEMS VERSION:1.8.15
- RUBY VERSION:1.9.3(2012- 02-16 patchlevel 125)[x86_64-linux]
- 安装目录:/home/user/.rvm/gems/ruby-1.9.3-p125@myapp
- RUBY EXECUTABLE:/home/user/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
- EXECUTABLE DIRECTORY:/home/user/.rvm /gems/ruby-1.9.3-p125@myapp/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/user/.rvm/gems/ruby-1.9.3-p125@ myapp
- /home/user/.rvm/gems/ruby-1.9.3-p125@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- RUBYGEMS VERSION:1.8.15
我们的deploy.rb在这里
需要bundler / capistrano
set:application,myapp
set:repository,#{application} @myserver:/ home /git/repos/#{application}.git
set:scm,:git
set:user,#{application}
set:use_sudo,false
set :deploy_to/ home /#{application} /#{application}
set:deploy_via,:remote_cache
set:keep_releases,5
servermyserver app,:web,:db,:primary => true
set:branch,master
ssh_options [:forward_agent] = false
default_run_options [:pty] = true
之前的部署:资产:预编译,捆绑:安装
加载'部署/资产'
命名空间:deploy do
任务:结束
任务:停止做; end
task:restart,:roles => :app,:except => {:no_release => #$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
$ >
我们的Developmentsetup
我们使用Apache + Passagner和rvm安装 http://beginrescueend.com/rvm/install/ 。
在服务器上,我们以相同的方式安装它。每个用户(应用程序,gemsets或realuser)都必须是组rvm的成员...我们使用模块安装passagner ...
http://www.modrails.com/documentation/Users%20guide%20Apache.html#_installing_via_the_gem
但是为什么我使用 cap deploy:cold
时会出现错误。 cap deploy:check
say 您似乎已安装所有必需的依赖项
错误在这里<对于`deploy:finalize_update'回调
*执行`bundle:install'
*执行ls -x / home / myapp / myapp / releases
servers:[myserver]
[myserver]执行命令
[myserver] sh -c'ls -x / home / myapp / myapp / release'
命令在82ms
*中完成执行cd / home / myapp / myapp / releases / 20120331143114&& bundle install --gemfile / home / myapp / myapp / releases / 20120331143114 / Gemfile --path / home / m
ahaloo / myapp / shared / bundle --deployment --quiet - 没有开发测试
servers:[myserver]
[myserver]执行命令
[myserver] sh -c'cd / home / myapp / myapp / releases / 20120331143114&捆绑安装--gemfile / home / myapp / myapp / releases / 20120331143114 / Gemfile --path / h
ome / myapp / myapp / shared / bundle --deployment --quiet - 没有开发测试'
** [out :: myserver] sh:bundle:not found
command在73ms
*** [deploy:update_code] roll back
*执行rm -rf / home / myapp / myapp / releases / 20120331143114; true
servers:[myserver]
[myserver]执行命令
[myserver] sh -c'rm -rf / home / myapp / myapp /释放/ 20120331143114;
命令在171ms内完成
失败:sh -c'cd / home / myapp / myapp / releases / 20120331143114&& bundle install --gemfile / home / myapp / myapp / releases / 20120331143114 / gemfile --path / home /
myapp / myapp / shared / bundle --deployment --quiet - 没有开发测试'on myserver
marcus @ lenny:〜/ dev / workspace / myapp $
我们的包列表
* actionmailer(3.2.0)
* actionpack(3.2.0)
* activemodel(3.2.0 )
* activerecord(3.2.0)
* activeresource(3.2.0)
*活动支持(3.2.0)
* arel(3.0.2)
* builder(3.0.0)
* bundler(1.1.1)
* capistrano(2.11.2)
* coffee-rails(3.2.1)
* coffee-script 2.2.0)
* coffee-script-source(1.2.0)
* erubis(2.7.0)
* execjs(1.3.0)
* highline(1.6。 11)
*远足(1.2.1)
* i18n(0.6.0)
*旅程(1.0.3)
* jquery-rails(1.0.17)
* json(1.6.5)
* libv8(3.3.10.4)
* mail(2.4.4)
* mime类型(1.17.2)
* multi_json(1.1.0)
* net-scp (1.0.4)
* net-sftp(2.0.5)
* net-ssh(2.3.0)
* net-ssh-gateway(1.1.0)
* polyglot(0.3.3)
*机架(1.4.1)
*机架缓存(1.2)
* rack-ssl(1.3.2)
*机架测试(0.6.1)
* rails(3.2.0)
* railties(3.2.0)
* rake(0.9.2.2)
* rdoc(3.12)
* sass(3.1.15)
* sass-rails(3.2.0)
* simple_form(2.0.1)
*链轮(2.1.2)
* sqlite3 1.3.5)
* therubyracer(0.9.10)
* thor(0.14.6)
* tilt(1.3.3)
* treetop(1.4.10)
* tzinfo(0.3.32)
* uglifier(1.2.3)
* uuidtools(2.1.2)
有人可以帮助我们找到工作的capistrano
检查你的Capistrano路径执行 cap shell ,然后 echo $ PATH 。您可能会看到您的标准/ usr / local / bin和/ usr / bin,但这不是RVM拥有Bundler的地方。
编辑您的Capistrano config / deploy.rb文件,并添加以下行:
#将RVM的lib目录添加到加载路径。
$ :. unshift(File.expand_path('./ lib',ENV ['rvm_path']))
#加载RVM的capistrano插件。
需要rvm / capistrano
set:rvm_ruby_string,'1.9.2'
set:rvm_type,:user#不要使用系统范围的RVM
Rails 3 - Bundler / Capistrano错误
I have two Questions. One small and one greater problem.
- Why i have to enter the passphrase 10 times my running cap:cold
After i tryed to setup an capistrano via teachmetocode-tuorial and with some helps of stackoverflow. I sat down, with many tutorials of deploying capistrano and write my own new Version of the deploy.rb Our gem env output looks so
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/user/.rvm/gems/ruby-1.9.3-p125@myapp
- RUBY EXECUTABLE: /home/user/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
- EXECUTABLE DIRECTORY: /home/user/.rvm/gems/ruby-1.9.3-p125@myapp/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/user/.rvm/gems/ruby-1.9.3-p125@myapp
- /home/user/.rvm/gems/ruby-1.9.3-p125@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- RUBYGEMS VERSION: 1.8.15
And our deploy.rb is here
require "bundler/capistrano"
set :application, "myapp"
set :repository, "#{application}@myserver:/home/git/repos/#{application}.git"
set :scm, :git
set :user, "#{application}"
set :use_sudo, false
set :deploy_to, "/home/#{application}/#{application}"
set :deploy_via, :remote_cache
set :keep_releases, 5
server "myserver", :app, :web, :db, :primary => true
set :branch, "master"
ssh_options[:forward_agent] = false
default_run_options[:pty] = true
before "deploy:assets:precompile", "bundle:install"
load 'deploy/assets'
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
Our Developmentsetup We use Apache+Passagner and the rvm installation of http://beginrescueend.com/rvm/install/. On the server we install it on the same way. Every User(apps, gemsets or realuser) have to be a member of group rvm... We use modrails to install the passagner... http://www.modrails.com/documentation/Users%20guide%20Apache.html#_installing_via_the_gem
But why get i an error when i use cap deploy:cold
. The cap deploy:check
say You appear to have all necessary dependencies installed
The error is here
triggering after callbacks for `deploy:finalize_update'
* executing `bundle:install'
* executing "ls -x /home/myapp/myapp/releases"
servers: ["myserver"]
[myserver] executing command
[myserver] sh -c 'ls -x /home/myapp/myapp/releases'
command finished in 82ms
* executing "cd /home/myapp/myapp/releases/20120331143114 && bundle install --gemfile /home/myapp/myapp/releases/20120331143114/Gemfile --path /home/m
ahaloo/myapp/shared/bundle --deployment --quiet --without development test"
servers: ["myserver"]
[myserver] executing command
[myserver] sh -c 'cd /home/myapp/myapp/releases/20120331143114 && bundle install --gemfile /home/myapp/myapp/releases/20120331143114/Gemfile --path /h
ome/myapp/myapp/shared/bundle --deployment --quiet --without development test'
** [out :: myserver] sh: bundle: not found
command finished in 73ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/myapp/myapp/releases/20120331143114; true"
servers: ["myserver"]
[myserver] executing command
[myserver] sh -c 'rm -rf /home/myapp/myapp/releases/20120331143114; true'
command finished in 171ms
failed: "sh -c 'cd /home/myapp/myapp/releases/20120331143114 && bundle install --gemfile /home/myapp/myapp/releases/20120331143114/Gemfile --path /home/
myapp/myapp/shared/bundle --deployment --quiet --without development test'" on myserver
marcus@lenny:~/dev/workspace/myapp$
Our bundle list
is here
* actionmailer (3.2.0)
* actionpack (3.2.0)
* activemodel (3.2.0)
* activerecord (3.2.0)
* activeresource (3.2.0)
* activesupport (3.2.0)
* arel (3.0.2)
* builder (3.0.0)
* bundler (1.1.1)
* capistrano (2.11.2)
* coffee-rails (3.2.1)
* coffee-script (2.2.0)
* coffee-script-source (1.2.0)
* erubis (2.7.0)
* execjs (1.3.0)
* highline (1.6.11)
* hike (1.2.1)
* i18n (0.6.0)
* journey (1.0.3)
* jquery-rails (1.0.17)
* json (1.6.5)
* libv8 (3.3.10.4)
* mail (2.4.4)
* mime-types (1.17.2)
* multi_json (1.1.0)
* net-scp (1.0.4)
* net-sftp (2.0.5)
* net-ssh (2.3.0)
* net-ssh-gateway (1.1.0)
* polyglot (0.3.3)
* rack (1.4.1)
* rack-cache (1.2)
* rack-ssl (1.3.2)
* rack-test (0.6.1)
* rails (3.2.0)
* railties (3.2.0)
* rake (0.9.2.2)
* rdoc (3.12)
* sass (3.1.15)
* sass-rails (3.2.0)
* simple_form (2.0.1)
* sprockets (2.1.2)
* sqlite3 (1.3.5)
* therubyracer (0.9.10)
* thor (0.14.6)
* tilt (1.3.3)
* treetop (1.4.10)
* tzinfo (0.3.32)
* uglifier (1.2.3)
* uuidtools (2.1.2)
Can someone help us please to get a working capistrano
Check your Capistrano path by doing cap shell, then echo $PATH. U'll probably see your standard /usr/local/bin and /usr/bin, but that's not where RVM has Bundler
Edit your Capistrano config/deploy.rb file, and add the following lines:
# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
# Load RVM's capistrano plugin.
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2'
set :rvm_type, :user # Don't use system-wide RVM
Rails 3 -- Bundler/Capistrano Errors
这篇关于Capistrano部署:感冒不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!