使用环境变量中设置的路径安装Rails Admin

时间:2014-05-14 07:07:02

标签: ruby-on-rails ruby ruby-on-rails-4 environment-variables rails-admin

Rails admin的安装方式如下:

Rails.application.routes.draw do
  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
  ...
end

当我尝试将管理路径设置为环境变量时,如下所示:

Rails.application.routes.draw do
  mount RailsAdmin::Engine => ENV['ADMIN_PATH'], as: 'rails_admin'
  ...
end

我得到以下异常:

.../ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/routing/mapper.rb:507:in 
  `mount': A rack application must be specified (RuntimeError)

有人能指出我正确的方向吗?

0 个答案:

没有答案