例如,当我调用任何 Capifony 数据库函数时cap database:move:to_remote
,我会收到以下 ruby 错误:
jeremykendall@isr-thinkpad-420s:~/dev/sites/app$ cap develop database:move:to_remote
triggering load callbacks
* executing `develop'
triggering start callbacks for `database:move:to_remote'
* executing `multistage:ensure'
* executing `database:move:to_remote'
* executing `database:dump:local'
/home/jeremykendall/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- FileUtils (LoadError)
from /home/jeremykendall/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capifony-2.1.5/lib/symfony2.rb:101:in `block (3 levels) in load'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capifony-2.1.5/lib/symfony2.rb:159:in `block (3 levels) in load'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:139:in `instance_eval'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:139:in `invoke_task_directly'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:45:in `each'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:34:in `execute!'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/lib/capistrano/cli/execute.rb:14:in `execute'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/gems/capistrano-2.11.2/bin/cap:4:in `<top (required)>'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/bin/cap:19:in `load'
from /home/jeremykendall/.rvm/gems/ruby-1.9.3-p125@interperf/bin/cap:19:in `<main>'
我的部署.rb:
set :stage_dir, 'app/config/deploy'
require 'capistrano/ext/multistage'
set :stages, %w{production testing develop}
default_run_options[:pty] = true
set :application, "appname"
set :deploy_to, "/home/isr/sites/app"
set :deploy_via, :remote_cache
set :scm, :git
set :repository, "git@github.com:jeremykendall/redacted.git"
set :user, "isr"
set :use_sudo, false
ssh_options[:forward_agent] = true
set :model_manager, "doctrine"
set :keep_releases, 3
set :update_vendors, true
set :shared_files, ["app/config/parameters.yml", "app/config/parameters.ini"]
set :shared_children, [app_path + "/logs", app_path + "/cache", web_path + "/uploads", "vendor"]
我的 app/config/deploy/develop.rb
# Deploys to local vagrant box
set :domain, "192.168.33.10"
set :symfony_env_prod, "dev"
set :deploy_to, "/home/vagrant/sites/app"
set :branch, "develop"
set :user, "vagrant"
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run
我试过的
gem install fileutils
sudo aptitude install libfileutils-ocaml-dev
(抓住 FileUtils 吸管)gem update --system
gem update