2014-03-26 103 views
1

我已經安裝了RVM和Capistrano,但似乎遇到了錯誤。Capistrano 3.1.0部署問題與Rake> = 10.2.0

我的Gemfile:

source 'https://rubygems.org' 
gem 'sass' 
gem 'compass' 
gem 'capistrano-rvm' 
gem 'capistrano', '~> 3.1.0' 

我的紅寶石版本:

$ ruby -v 
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0] 

然後我運行:

$ cap install 
mkdir -p config/deploy 
create config/deploy.rb 
create config/deploy/staging.rb 
create config/deploy/production.rb 
mkdir -p lib/capistrano/tasks 
Capified 

然後:

$ cap deploy:check 
cap aborted! 
TypeError: no implicit conversion of Rake::Task into String 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/gems/capistrano-3.1.0/lib/capistrano/application.rb:15:in `run' 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/gems/capistrano-3.1.0/bin/cap:3:in `<top (required)>' 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/bin/cap:23:in `load' 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/bin/cap:23:in `<main>' 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval' 
/Users/ianjamieson/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>' 
(See full trace by running task with --trace) 

返回任何東西的唯一帽的命令是:

$ cap -V 
Capistrano Version: 3.1.0 (Rake Version: 10.2.1) 
$ cap -vT 
cap deploy       # Deploy a new release 
cap deploy:check     # Check required files and directories exist 
cap deploy:check:directories  # Check shared and release directories exist 
cap deploy:check:linked_dirs  # Check directories to be linked exist in shared 
cap deploy:check:linked_files  # Check files to be linked exist in shared 
cap deploy:check:make_linked_dirs # Check directories of files to be linked exist in shared 
cap deploy:cleanup     # Clean up old releases 
cap deploy:cleanup_rollback  # Remove and archive rolled-back release 
cap deploy:finished    # Finished 
cap deploy:finishing    # Finish the deployment, clean up server(s) 
cap deploy:finishing_rollback  # Finish the rollback, clean up server(s) 
cap deploy:log_revision   # Log details of the deploy 
cap deploy:published    # Published 
cap deploy:publishing    # Publish the release 
cap deploy:revert_release   # Revert to previous release timestamp 
cap deploy:reverted    # Reverted 
cap deploy:reverting    # Revert server(s) to previous release 
cap deploy:rollback    # Rollback to previous release 
cap deploy:started     # Started 
cap deploy:starting    # Start a deployment, make sure server(s) ready 
cap deploy:symlink:linked_dirs  # Symlink linked directories 
cap deploy:symlink:linked_files # Symlink linked files 
cap deploy:symlink:release   # Symlink release to current 
cap deploy:symlink:shared   # Symlink files and directories from shared to release 
cap deploy:updated     # Updated 
cap deploy:updating    # Update server(s) by setting up a new release 
cap install      # Install Capistrano, cap install STAGES=staging,production 

任何想法?

回答

2

Capistrano的3.1.0有一個兼容性問題耙> = 10.2.0。我真的很驚訝cap staging deploy:check爲你工作。

我已經提交了一個pull request以解決它,但同時你可以鎖定你的Gemfile到Rake 10.1.1。

+0

不錯!不能相信這是問題! '$ cap'現在返回'Stage沒有設置,請打電話給'cap production deploy',其中生產是你定義的一個階段。 –

1

不知道有什麼問題,但嘗試運行bundle exec cap staging deploy:check

+0

啊,這似乎工作,還'蓋帽分期'我想我已經習慣於不必定義'分期'。我認爲它可以默認,如果沒有輸入,但可能不是!尼斯友好的錯誤! –