| Message: 98248 |
 |
BY: David Adler (dadler) DATE: 2012-08-16 11:36 SUBJECT: RE: Ruby crash accessing initial web page This problem is very strange.
I reinstalled ruby 1.9.2, rails 3.2.8 and ibm_db.
Creating a new project was successful and there was no crash when opening http://localhost:3000.
Creating a new application and scaffold followed by 'rake db:migrate' was successful.
Attempting to run the application http://localhost:3000/friends failed with the messages:
Started GET "/friends" for 127.0.0.1 at 2012-08-16 07:24:04 -0400
Processing by FriendsController#index as HTML
[1m[36mFriend Load (279.0ms)[0m [1mSELECT friends.* FROM friends [0m
Completed 500 Internal Server Error in 1639ms
NoMethodError (undefined method `explain' for #<ActiveRecord::ConnectionAdapters::IBM_DBAdapter:0xa937088>):
app/controllers/friends_controller.rb:5:in `index'
After manually inserting a row into the 'friends' table, this was successful:
Started GET "/friends" for 127.0.0.1 at 2012-08-16 07:28:13 -0400
Processing by FriendsController#index as HTML
[1m[35mFriend Load (3.0ms)[0m SELECT friends.* FROM friends
Rendered friends/index.html.erb within layouts/application (3.0ms)
Compiled friends.css (43ms) (pid 7288)
Compiled scaffolds.css (11ms) (pid 7288)
Compiled application.css (79ms) (pid 7288)
Compiled jquery.js (11ms) (pid 7288)
Compiled jquery_ujs.js (1ms) (pid 7288)
Compiled friends.js (193ms) (pid 7288)
Compiled application.js (366ms) (pid 7288)
Completed 200 OK in 536ms (Views: 528.0ms | ActiveRecord: 3.0ms)
Strangely, the first id value was 2 and not 1. Deleting all the rows from the table, the application was still successful.
| |