`method_missing&#39 ;:未定义的方法`active_record&#39; for#<rails :: application :: configuration - =“”rails =“”with =“”mongodb =“”

时间:2015-10-13 14:20:28

标签: ruby-on-rails mongodb devise

=“”

使用我和mongoDB创建了rails new app。

rails new app_name --skip-active-record

我用过

gem 'mongoid', '~> 5.0.0.beta', github: 'mongoid/mongoid'
gem 'bson_ext'
gem 'devise'

当我尝试rails g devise:install时,会引发错误

  

method_missing': undefined method active_record&#39; #(NoMethodError)

和config / application.rb

require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"

需要帮助。

1 个答案:

答案 0 :(得分:0)

创建应用时,跳过active_record - 稍后您会收到无法找到active_record的错误。

您是否尝试过创建没有--skip-active-record标志的应用程序?

修改:

看起来像you were right to skip active record,但您忘记了rails g mongoid:config