Я пытаюсь развернуть мое приложение node.js, используя capistrano-node-deploy. При запуске cap deploy
я получаю следующее сообщение об ошибке:Ошибка при развертывании при развертывании capistrano-node
$ cap deploy
/usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require': no such file to load -- capistrano/node-deploy (LoadError)
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require'
from Capfile:1:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:31:in `execute!'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
Мои Gemfile
выглядит как этот
source 'https://rubygems.org'
gem 'capistrano', '~> 2.15.5'
gem 'capistrano-node-deploy', '~> 1.2.11'
gem 'capistrano_rsync_with_remote_cache', '~> 2.4.0'
gem 'capistrano-shared_file', '~> 0.1.3'
тогда я сделал bundle install
который оказался успешным:
$ bundle install
Using highline (1.6.20)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using net-sftp (2.1.2)
Using net-ssh-gateway (1.2.0)
Using capistrano (2.15.5)
Using multi_json (1.3.7)
Using railsless-deploy (1.1.2)
Using capistrano-node-deploy (1.2.11)
Using capistrano-shared_file (0.1.3)
Using capistrano_rsync_with_remote_cache (2.4.0)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Затем я создал Capfile
, который следует на основании this blog post
require "capistrano/node-deploy"
require "capistrano/shared_file"
set :application, "tff"
set :user, "ubuntu"
set :deploy_to, "/home/ubuntu/www/tff"
set :node_user, "ubuntu"
set :node_env, "production"
set :scm, :git
set :repository, "/home/ubuntu/tff/tff.git"
set :deploy_via, :rsync_with_remote_cache
role :app, "example.org"
set :shared_files, ["config.js"]
set :shared_children, ["content/data", "content/images"]
set :keep_releases, 5
namespace :deploy do
task :mkdir_shared do
run "cd #{shared_path} && mkdir -p data images files"
end
end
after "deploy:create_symlink", "deploy:mkdir_shared"
Даже более базовая настройка приводит к той же ошибке для меня, то есть неспособна к require "capistrano/node-deploy"
. Есть идеи?
Я, кажется, исправил это, выполнив еще несколько 'require' в Gemfile.My '$ GEM_PATH' пуст, хотя, должен ли я установить его тоже? – djskinner
Это не лучшее решение, поэтому без необходимости не стоит. – fizikst