为 'capistrano-maintenace' 配置 maintenance_template_path gem
Configure maintenance_template_path for 'capistrano-maintenace' gem
在 capistrano/maintenance
gem 中,我无法设置 :maintenance_template_path
变量的路径。
我试过了
# Set the maintenance file path
set :maintenance_template_path, '/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance'
set :maintenance_template_path, '/app/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance.erb.html'
set :maintenance_template_path, '/views/errors/maintenance.erb.html'
set :maintenance_template_path, 'app/views/errors/maintenance.erb.html'
我一直收到 No such file or directory @ rb_sysopen
错误。
文件在正确的位置/Users/David/Documents/Development/myRailsApp/app/views/errors/maintenance.erb.html
正确的配置是什么?
需要绝对路径。假设您使用的是 config/deploy.rb
,那么您可以这样做:
set :maintenance_template_path,
File.expand_path("../../app/views/errors/maintenance.erb.html", __FILE__)
在 capistrano/maintenance
gem 中,我无法设置 :maintenance_template_path
变量的路径。
我试过了
# Set the maintenance file path
set :maintenance_template_path, '/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance'
set :maintenance_template_path, '/app/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance.erb.html'
set :maintenance_template_path, '/views/errors/maintenance.erb.html'
set :maintenance_template_path, 'app/views/errors/maintenance.erb.html'
我一直收到 No such file or directory @ rb_sysopen
错误。
文件在正确的位置/Users/David/Documents/Development/myRailsApp/app/views/errors/maintenance.erb.html
正确的配置是什么?
需要绝对路径。假设您使用的是 config/deploy.rb
,那么您可以这样做:
set :maintenance_template_path,
File.expand_path("../../app/views/errors/maintenance.erb.html", __FILE__)