Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
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
Friend Load (279.0ms) SELECT friends.* FROM friends 
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
Friend Load (3.0ms) 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.


Thread View

Thread Author Date
Ruby crash accessing initial web pageDavid Adler2012-08-15 16:35
      RE: Ruby crash accessing initial web pagePraveen Devarao2012-08-15 16:55
            RE: Ruby crash accessing initial web pageDavid Adler2012-08-15 17:29
      RE: Ruby crash accessing initial web pageDavid Adler2012-08-16 11:36
            RE: Ruby crash accessing initial web pagePraveen Devarao2012-08-16 12:02
                  RE: Ruby crash accessing initial web pageDavid Adler2012-08-16 17:19
                        RE: Ruby crash accessing initial web pageDavid Adler2012-08-17 14:33
                              RE: Ruby crash accessing initial web pagePraveen Devarao2012-08-19 04:02

Post a followup to this message