我已经使用 rails 构建了一个示例应用程序,并尝试使用 capistrano 将其部署到 bluehost。但我没有这样做。我按照此http://vasil-y.com/2012/08/21/rails-capistrano-git-bluehost/中提到的说明进行操作
这是我的 config/deploy.rb 的内容:
require 'bundler/capistrano'
set :application, "rails_scaffold"
# BlueHost SSH user
set :user, "username"
# App Domain
set :domain, "example.com"
# We don't need sudo on BlueHost
set :use_sudo, false
# git is our SCM
set :scm, :git
# master is our default git branch
set :branch, "master"
# Use local git repository
set :repository, "#{domain}:/home/#{user}/rails_apps/#{application}"
set :local_repository, "."
# Checkout, compress and send a local copy
set deploy_via, :copy
set deploy_to, "/home/#{user}/rails_apps/#{application}"
# We have all components of the app on the same server
server domain, :app, :web, :db, :primary => true
namespace :deploy do
task :start do ; end
task :stop do ; end
# Touch tmp/restart.txt to tell Phusion Passenger about new version
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path, 'tmp', 'restart.txt')}"
end
end
# Clean-up old releases
after "deploy:restart", "deploy:cleanup"
但是当我运行 cap deploy:setup 命令时,出现以下错误:
/home/swaroop/.rvm/gems/ruby-1.9.3-p362/gems/capistrano-2.14.2/lib/capistrano/configuration/variables.rb:22:in `set': invalid variable `/u/apps/rails_scaffold' (variables must begin with an underscore, or a lower-case letter) (ArgumentError)
它说应用程序名称必须以下划线或小写字母开头。我的应用程序名称看起来是有效的。我在这里做错了什么?
谢谢你