我有一個安裝了Ruby 2.1.1的VPS安裝程序,並且本地安裝了相同的版本。我的開發機器運行14.04 Ubuntu報告ruby -v = ruby 2.1.1p76(2014-02-24修訂版45161)[x86_64-linux]和rbenv -v = rbenv 0.4.0-97-gfe0b243。試圖安裝與Capistrano 3和rbenv的rails應用程序
我最初在服務器上使用刀獨奏安裝紅寶石,但它似乎像capistrano想照顧這一點。
當我運行帽分期部署我得到一個錯誤
rbenv: cap: command not found
The `cap' command exists in these Ruby versions: 2.1.0
的Gemfile
group :development do
gem 'capistrano', github: 'capistrano/capistrano', ref: 'master'
gem 'capistrano-rails', github: 'capistrano/rails', ref: 'master'
gem 'capistrano-bundler'
gem 'capistrano-rbenv', "~> 2.0"
end
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
deploy.rb
set :rbenv_type, :system
set :rbenv_ruby, '2.1.1'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :rbenv_roles, :all # default value
寶石ENV
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/mark/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: /home/mark/.rbenv/versions/2.1.1/bin/ruby
- EXECUTABLE DIRECTORY: /home/mark/.rbenv/versions/2.1.1/bin
- SPEC CACHE DIRECTORY: /home/mark/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/mark/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0
- /home/mark/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/mark/.rbenv/versions/2.1.1/bin
你嘗試'rbenv rehash'使rbenv產生Capistrano的二進制墊片。 –
是的,它沒有區別。 – markhorrocks
'gem'capistrano','3.2'寶石'capistrano-rails','1.1''你爲什麼指出主分支 –