Ok I have been trying to get started with Ruby on Rails and I want to
tie it together with a mysql database. I have been using the
examples in teh Agile Web Developkent with Rails, which has you setup
the database.yml file and run rake db:migrate to make sure you can
Well this all works great.
Next you create a model using script/generate model Account
Once this is created if you run rake db:migrate it will fail. Giving
you an unitialized constant CreateAccount error.
After doing some research online it appears the the file that is
generated is named wrong and that is much exactly match the name of
the class definition inside the migration file.
The generated file is 001_create_accounts.rb
/************ Migration File 001_create_accounts.rb
class CreateAccounts < ActiveRecord::Migration
create_table :accounts do |t|
I renamed the file to 001_CreateAccounts.rb, however now I get this :
Storm$ rake db:migrate – trace
* config.breakpoint_server has been deprecated and has no
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.first
Anyone have any ideas or can point me to a good working code example.
I just really want to leverage the object relational mapping