我看到NoMethodError:未定義的方法`取」爲‘QLite 3.x版本’:字符串
SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xx: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
NoMethodError: undefined method `fetch' for "QLite version 3.x":String
此錯誤是由日命令調用,當我嘗試部署我的Rails應用到生產這個錯誤
Command: cd /home/deploy/myapp/releases/20140616034148 && (RAILS_ENV=production ~/.rvm/bin/rvm default do bundle exec rake assets:precompile)
capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rvm'
set :rvm_ruby_version, '2.1.2'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
deploy.rb
lock '3.1.0'
set :application, 'myapp'
set :repo_url, '[email protected]:username/myapp.git'
set :deploy_to, '/home/deploy/myapp'
set :branch, "master"
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
production.rb
set :stage, :production
role :app, %w{[email protected]}
role :web, %w{[email protected]}
role :db, %w{[email protected]}
set :password, ask('Server password', nil)
server '107.170.187.98', user: 'deploy', password: fetch(:password), roles: %w{web app}
set :bundle_env_variables, { 'NOKOGIRI_USE_SYSTEM_LIBRARIES' => 1 }
我不明白是什麼原因造成了這個問題。有人可以指出我的方向是正確的嗎?
謝謝,這是確切的問題 – Arun