imagemagick - Undefined method `has_attached_file` with Paperclip and Rails -
i'm having trouble getting paperclip working on vps. works fine locally , on first vps, when try rake db:migrate
on second vps, following output:
root@test:/home/rails# rake db:migrate == creategroups: migrating =================================================== -- create_table(:groups) -> 0.0019s -- add_column(:discussions, :group_id, :integer) -> 0.0007s -- add_column(:memberships, :memberships_id, :integer) -> 0.0006s -- has_attached_file(:photo, {:styles=>{:original=>"400x200>", :tile=>"200x200#"}, :url=>"/assets/images/groups/:id/:style/:basename.:extension", :path=>":rails_root/public/assets/images/groups/:id/:style/:basename.:extension", :default_url=>"/assets/:style/missing-group-image.jpg"}) rake aborted! error has occurred, , later migrations canceled: undefined method `has_attached_file' #<creategroups:0x0000000342cbf8>/usr/local/rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.8/lib/active_record/migration.rb:465:in `block in method_missing' ...
what i've done far set second vps is:
- set unicorn + nginx (they seem working fine)
apt-get install git
apt-get install imagemagick
bundle install
(and paperclip in gemfile)- restarted shell
- rebooted vps
after of this, i'm still getting above error whenever try migrate. ideas of next?
i think didn't quite follow paperclip installation guide. should have following migration (copied paperclip readme may differ you)
class addavatarcolumnstousers < activerecord::migration def self.up add_attachment :users, :avatar end def self.down remove_attachment :users, :avatar end end
and apparently put there should in model.
Comments
Post a Comment