I have a simple controller (browse) that uses a “books” action to
display a list of books (stored in a mysql db) and a “book_details”
action to display the details of a particular book (according to the
book’s mysql id). The book_details action is accessed via a link from
the books action via the following snippet:
<a href=<%= “/browse/book_details/#{_bookID}” %> class=“text11”
style=“text-decoration:none”>
<%= _title %>
where _title is properly set to the book’s title and _bookID is the
mysql id of the book. I’ve verified that _title and _bookID are set
properly. Equivalently, I’ve also used the following snippet instead
of the above:
<%= link_to(_title,
{ :controller => “browse”,
:action => “book_details”,
:id => _bookID
}) %>
In both of the above cases, I’m using the default route: map.connect
‘:controller/:action/:id’
In my test environment (Windows XP, Instant Rails, Aptana IDE)
everything works just fine. When I try to run this in production mode
on the ISP’s site (asmallorange.com - CentOS) the books action works
just fine but the book_details action results in the extremely
descriptive error message displayed as a webpage:
Application error
Rails application failed to start properly
For the life of me, I don’t see what I’m doing wrong. On the ISP site,
I set the log level to debug and compared the log files from both the
test (Windows XP) and production (CentOS) environments. The only
difference I could find is that in the CentOS production log, I see a
SQL_AUTO_IS_NULL message in the log file. I can’t figure out what this
means and am not sure how relevant it is. Any suggestions are
appreciated. Should I do something special with the routes?
Below are the two log files.
====================
test environment log file that works (Windows XP)
Processing BrowseController#book_details (for 127.0.0.1 at 2008-01-21
14:20:22)
[GET]
Session ID: e49a3adf336e845be40dc8573f2b32c9
Parameters: {“action”=>“book_details”, “id”=>“1”,
“controller”=>“browse”}
e$B"+e(B[4;35;1mBook Columns (0.000000)e$B"+e(B[0m e$B"+e(B[0mSHOW
FIELDS FROM
bookse$B"+e(B[0m
e$B"+e(B[4;36;1mBook Load (0.000000)e$B"+e(B[0m e$B"+e(B[0;1mSELECT
- FROM books WHERE
(books.id
= 1) e$B"+e(B[0m
Rendering within layouts/browse
Rendering browse/book_details
Completed in 0.01600 (62 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.00000 (0%)
| 200 OK [http://localhost/browse/book_details/1]
====================
production environment log file that doesn’t work (CentOS)
Logfile created on Mon Jan 21 14:29:06 -0500 2008 by /
Processing BrowseController#book_details (for 69.143.120.176 at
2008-01-21 14:29
:06) [GET]
Session ID: ded95bf9e5a23822f854e9ba58d69d6e
Parameters: {“action”=>“book_details”, “id”=>“1”,
“controller”=>“browse”}
^[[4;36;1mSQL (0.000086)^[[0m ^[[0;1mSET SQL_AUTO_IS_NULL=0^[[0m
^[[4;35;1mBook Columns (0.001176)^[[0m ^[[0mSHOW FIELDS FROM
books^[[0m
^[[4;36;1mBook Load (0.000065)^[[0m ^[[0;1mSELECT * FROM books
WHERE (books.
id
= 1) ^[[0m
Rendering within layouts/browse
Rendering browse/book_details
Completed in 0.06461 (15 reqs/sec) | Rendering: 0.01440 (22%) | DB:
0.00133 (2%)
| 200 OK [http://www.epps-alford.com/browse/book_details/1]