I’m trying to follow the tutorial in the “agile web development with
rails” book which I bought. After creating the database migration file
for mysql, When I try to run rake on my database migration to create
table in mysql, I get
undefined method `each’ for #Mysql:0x38da498
any idea what i might be doing wrong?
I can connect to the database fine from command prompt with the username
and password set in my database .yml file.
the migration script is below
class CreateProducts < ActiveRecord::Migration
create_table :products do |t|
# t.column :name, :string
t.column :title, :string
t.column :description, :text
t.column :image_url, :string
exkgb: are the tables not fcreated or is it just the schema.rb that
doesn’t get written right? In my case the tables are there with all
attributes (including the current changes) but the schema.rb file is
I had the same version of the mysql ruby bindings twice, one as gem, the
other via gentoo (emerge). After I had removed both of them, I got a
different error (/tmp/mysql.sock missing). I then installed the mysql
gem again and everything works fine again.
I guess the trick was the recompilation after the new version of mysql
was installed. Although I had reinstalled the gem version, rails might
have taken the gem version but the system version from gentoo.
Dominik Wei-fieg wrote:
same problem here, though my migration has worked until I got an upgrade
of mysql on my box.