2016-09-30 39 views
0

capistrano/maintenance宝石中,我无法设置:maintenance_template_path变量的路径。配置maintenance_template_path为'capistrano-maintenace'宝石

我已经试过

# 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

什么是正确的配置?

回答

1

它需要一个绝对路径。假设您使用的是config/deploy.rb,那么您可以这样做:

set :maintenance_template_path, 
    File.expand_path("../../app/views/errors/maintenance.erb.html", __FILE__)