2016-09-30 16 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__)