0

(see title) here is the code, I'm using ms command prompt (irb) to do this, which may in itself be wrong.

C:\Users\davo\Desktop\RailsProjects\sqlite>irb

\<\lass CreateProducts < ActiveRecord::Migration

irb(main):002:1> def up

irb(main):003:2> create_table :products do |t|

irb(main):004:3* t.string :name

irb(main):005:3> t.text :description

irb(main):006:3> t.timestamps

irb(main):007:3> end

irb(main):008:2> end

irb(main):009:1> end

NameError: uninitialized constant ActiveRecord

   from (irb):1

   from C:/Ruby193/bin/irb:12:in `<main>'

irb(main):010:0>

I know that it's not supposed to be \<\lass but that's not what I typed and I think that's not the issue but I'm not sure.

1 Answer 1

1

You need to require 'active_record'. I agree that you may run into other issues trying to migrate by hand.

3
  • What is the better way to do it? I'm a noob to rails. I'll look into it but I'd appreciate some Google-searchable keywords May 8, 2012 at 4:27
  • Just do the migration, then reverse it with db:rollback. Take a look at the Rails Migration guide for more info.
    – x1a4
    May 8, 2012 at 5:43
  • Everything works now that I've ironed out my problems with mysql. Everything works when mysql works in my experience. May 17, 2012 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.