在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
正确的配置是什么?
答案 0 :(得分:1)
它需要绝对路径。假设您正在使用config/deploy.rb
,那么您可以这样做:
set :maintenance_template_path,
File.expand_path("../../app/views/errors/maintenance.erb.html", __FILE__)