我正在按照本指南通过capistrano部署rails应用程序:https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning
我正在使用linode作为我的VPS。我已完成所有初始设置并cap deploy:setup/update/deploy
所有工作。当我在rails目录中执行此命令时:$ rake RAILS_ENV=production db:schema:load
。我得到undefined method 'minutes' for 90:Fixnum
。似乎activeSupport以某种方式未安装,但当我键入rails --version
时,我得到Rails 3.2.11
。任何见解都会非常有用!
这是我的deploy.rb
文件:
require 'bundler/capistrano'
require "capistrano-rbenv"
set :rbenv_ruby_version, "1.9.3-p392"
set :application, "uganda-coords"
# Deploy from your local Git repo by cloning and uploading a tarball
set :scm, :git
set :repository, "git@github.com:benrudolph/myapp.git"
set :deploy_via, :copy
set :scm_passphrase, "mypassword"
set :branch, "master"
set :deploy_via, :remote_cache
set :rails_env, "production"
set :user, :root
set :deploy_to, "/var/www/#{application}"
set :use_sudo, false
set :ssh_options, { :forward_agent => true }
role :web, "176.58.105.165" # Your HTTP server, Apache/etc
role :app, "176.58.105.165" # This may be the same as your `Web` server
role :db, "176.58.105.165", :primary => true # This is where Rails migrations will run
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
答案 0 :(得分:0)
原来这与在我的90.minutes
文件中使用application.rb
有关。我仍然不知道为什么这适用于开发而非生产。