重新安装rails_admin gem后未初始化的常量RailsAdmin错误

时间:2014-05-26 02:06:57

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

我正在将应用程序从Rails 3.2.6升级到4.1.1

在升级过程中,我取消注释了RailsAdmin gem并继续修复了我拥有的所有其他gem的所有依赖项。

我最近通过捆绑最新的RailsAdmin gem重新集成了RailsAdmin:

gem 'rails_admin', '~> 0.6.2'

我还触发了以下命令:

rails g rails_admin:install

启动服务器后,我现在收到以下错误:

未初始化的常量RailsAdmin

我确实在我的应用程序上运行了Devise,但是在我的路由中,我已经在我的路由中禁用了Devise管理员访问权限。我尝试重新安装RailsAdmin gem,但这似乎不起作用。

这是我的routes.rb

MyApp::Application.routes.draw do

  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
  resources :craigslist_shares

  devise_for :users,token_authentication_key: "auth_token", controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
  resources :users, only: [:index,:show] do
    collection do
      get :current
    end
  end

  resources :events do
    collection do
      post :facebook
      get :feed
      get :search
    end
    resources :attendees
    member do
     match "transaction", :as => :transit_to, via: [:get, :post]
     match "pitch", :as => :hitch_ride_to, via: [:get, :post]
     match "offer", :as => :offer_ride_to, via: [:get, :post]
    end
  end

....
....

以下是rails_admin.rb

RailsAdmin.config do |config|

  ### Popular gems integration

  # == Devise ==
  config.authenticate_with do
    warden.authenticate! scope: :user
  end
  config.current_user_method(&:current_user)

  ## == Cancan ==
  # config.authorize_with :cancan

  ## == PaperTrail ==
  # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0

  ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration

  config.actions do
    dashboard                     # mandatory
    index                         # mandatory
    new
    export
    bulk_delete
    show
    edit
    delete
    show_in_app

    ## With an audit adapter, you can add:
    # history_index
    # history_show
  end
end

0 个答案:

没有答案