with a simple table def.
class Objects < ActiveRecord::Migration
def self.up
create_table :objects do |table|
table.column :name, string
end
def self.down
drop_table :objects
end
end
when I run rake migrate, I get:
** Invoke migrate (first_time)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
./db/migrate//001_objects.rb:10: parse error, unexpected $, expecting
kEND
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in
load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in
load’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:340:in
migration_classes' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:190:in
inject’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:339:in
migration_classes' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:327:in
migrate’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:294:in
up' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:285:in
migrate’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/tasks/databases.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in
execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in
execute’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in
synchronize’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in
invoke_prerequisites’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in
invoke_prerequisites’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in
synchronize’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in
run’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
/usr/local/bin/rake:18
from terminal
and
e[4;36;1mSQL (0.031305)e[0m e[0;1mCREATE TABLE schema_info
(version int(11))e[0m
e[4;35;1mSQL (0.004014)e[0m e[0mINSERT INTO schema_info (version)
VALUES(0)e[0m
e[4;36;1mSQL (0.000000)e[0m e[0;1mMysql::Error: Table
‘schema_info’ already exists: CREATE TABLE schema_info (version
int(11))e[0m
e[4;36;1mSQL (0.000000)e[0m e[0;1mMysql::Error: Table
‘schema_info’ already exists: CREATE TABLE schema_info (version
int(11))e[0m
e[4;35;1mSQL (0.000000)e[0m e[0mMysql::Error: Table ‘schema_info’
already exists: CREATE TABLE schema_info (version int(11))e[0m
in the log.
(of course schema_info didn’t exist until I ran rake.)
I’ve googled this quite a bit and see people talking about ruby 1.8.4
breaking things, but I don’t find a specific comment about the model
making.
Any directions?
Thanks, in advance.