local variable or method `config' for main:Object (NameError)

前端 未结 3 1424
猫巷女王i
猫巷女王i 2021-02-14 03:14

I\'m following this post for integrating Omniauth Twitter + Devise http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ and I have encounter an i

3条回答
  •  春和景丽
    2021-02-14 03:45

    The article states that you should put some code in:

    config/environments/[environment].rb
    

    Where [environment].rb is meant to signify one of the following files:

    config/environments/development.rb
    config/environments/production.rb
    config/environments/test.rb
    

    You could also put the code in config/application.rb if you want the same settings across your different environments.

    The lines of code shown start with config.*, and they should be placed inside the Rails.application.configure do block.

    config/environment.rb in a typical Rails 4 application is just a require and Rails.application.initialize!, and should not need modification.

提交回复
热议问题