Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined local variable or method `config' for main:Object - rails

When I run the rails application, I get the following error:

undefined local variable or method "config" for main:Object

How can I resolve it?

like image 679
user1179589 Avatar asked Jan 31 '12 05:01

user1179589


2 Answers

My guess is that you found some code examples from an older version of rails, which called for you to place a config.gem * in your environment.rb file. To fix this add the gem requirement to your gemfile.

like image 60
jimmiebtlr Avatar answered Oct 03 '22 05:10

jimmiebtlr


in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.

This is what worked for me when I had a similar problem.

like image 39
The Ref Avatar answered Oct 03 '22 03:10

The Ref