Jump to content

The ultimate community for Ruby on Rails developers.


using rake db:seed I'm "Unable to autoload constant"

  • Please log in to reply
1 reply to this topic

#1 danvideo



  • Members
  • 1 posts

Posted 27 December 2013 - 01:50 AM

I recently created a new app and made models and migrations - now I am trying to populate the database with seed data and I'm getting the following error when I run "rake db:seed"


rake aborted!

Unable to autoload constant User_Reaction, expected MyApp/app/models/user_reaction.rb to define it
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:464:in `load_missing_constant'
/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:184:in `const_missing'
MyApp/db/seeds.rb:146:in `<top (required)>'


Here's my schema of the table it's cites "User_Reaction"


  create_table "user_reactions", force: true do |t|
    t.integer  "user_id"
    t.integer  "picture_id"
    t.boolean  "in_collection"
    t.integer  "has_rating"
    t.text     "comments"
    t.date     "click_buy"
    t.date     "click_share"
    t.datetime "created_at"
    t.datetime "updated_at"
  add_index "user_reactions", ["picture_id"], name: "index_user_reactions_on_picture_id"
  add_index "user_reactions", ["user_id"], name: "index_user_reactions_on_user_id"

Any ideas?

#2 Bharat Soni

Bharat Soni


  • Members
  • 55 posts
  • LocationAhmedabad

Posted 27 December 2013 - 02:16 PM

Please share the model where you have put the seed data.

Fun with Ruby on Rails

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users