Reputation: 362
I am writing a rails app, which has some modules and methods loaded via the lib directory, we have also added some methods in restful authentication module, now everytime when i run using mongrel server on production i dont get this error, although because model classes and controller classes are cached, but in development i do get this error, after the first time, so i start my server on development and run once i get the correct behavior, but when i refresh the page i get this nil.include error, while it displays that the each method is getting a nil to iterate, also i have done some homework, as i added the puts method, for all methods for that instance while iterating, i dont get any method definations for attributes of the table, like ID, name, title. i am unsure about this,
I am using Rails 2.2.2 and ruby 1.8.7. Server is mongrel & webrick.
Upvotes: 0
Views: 547
Reputation: 11319
This situation happened to me, where I used to get the error only after the refresh (i.e., second call to the server).
It may be that you have defined a module in your /lib
directory which does not matches the rails convention of file-naming. And you are using the require "filename.rb"
statement to get the module.
Try using require_dependency "filename.rb"
instead.
Let me know if problem still exists, we may look deeper.
Upvotes: 1
Reputation: 1400
You should look into the log/development.log or log/production.log files (depending on the environment you are investigating). The first line of the stacktrace shows the source of the error. Try to find the error there or post the relevant line (this and some above).
Upvotes: 1