class CreateUsersTable < ActiveRecord::Migration
def self.up
create_table “users” do |table|
end
def self.down
end
end
I’ve recently installed RoR (as per http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx)
and have been able to verify that everything is installed. I can create
tables ‘manually’ in MySQL databases, but rake is failing every time
with the same error as above.
Any help would be greatly appreciated. I’m investigating RoR with a view
to building some web apps with it, but this is hardly an auspicious
beginning.
class CreateUsersTable < ActiveRecord::Migration
def self.up
create_table “users” do |table|
end
You have a do in the line above which should be terminated with an end.
This “end” closes the “do” above, but nothing closes the “def” for the
self.up method.
def self.down
end
end
Try something like:
class CreateUsersTable < ActiveRecord::Migration
def self.up
create_table “users” do |table| #do something here like creating fields inside the table
end
end
Thanks for your reply - you’re quite right, of course. I’ll pay more
attention when copying and pasting sample code next time!
Mohit S. wrote:
Chris B. wrote:
class CreateUsersTable < ActiveRecord::Migration
def self.up
create_table “users” do |table|
end
You have a do in the line above which should be terminated with an end.
This “end” closes the “do” above, but nothing closes the “def” for the
self.up method.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.