Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

rake aborted, StandardError: An error has occurred, this and all later migrations canceled:

While running rake db:migrate, am getting this error

rake aborted, StandardError: An error has occurred, this and all later migrations canceled:

undefined method attachment' for #<ActiveRecord::ConnectionAdapters::Table:0x00000005118370>/home/ubuntu/workspace/db/migrate/20150623045556_add_attachment_image_to_pins.rb:4:inblock in up'

here is my code after an image through paperclip

class AddAttachmentImageToPins < ActiveRecord::Migration def self.up change_table :pins do |t| t.attachment :image end end

def self.down remove_attachment :pins, :image end end

what is wrong ? someone help me?

1 Answer

Milo Winningham
seal-mask
.a{fill-rule:evenodd;}techdegree
Milo Winningham
Web Development Techdegree Student 3,317 Points

Sounds to me like Paperclip hasn't been loaded in your app. Do you have gem 'paperclip' in your Gemfile, and if so, have you run bundle install?