I'm trying to use the generate script to create a controller. I run the following command:
> ruby script/generate controller Greeting
and the controller seems to be generated no problem. Then I add a method called index to the GreetingController:
class GreetingController < ApplicationController
def index
render :text => "<h1>Welcome to your first Rails application<h1>"
end
end
I then start the WEBrick web server, and direct my browser to http://127.0.0.1:3000/greeting, but I get an error message in the browser saying:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.
It should be working, at least according to the book I'm reading, Ruby on Rails by O'Reilly. Any idea what could be going wrong? The book was written a few years back, and I'm using what's probably a newer version or Rails. Any ideas?
UPDATE Here's what's in development.log:
/!\ FAILSAFE /!\ Sat Nov 28 22:11:12 -0500 2009
Status: 500 Internal Server Error
no such file to load -- mysql
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
FYI I created the application by calling:
rails /home/myuser/www/mynewapp -d mysql