我在使用Paperclip處理我的VPS時遇到了一些麻煩。它的工作原理局部精細和我的第一個VPS,但是當我嘗試rake db:migrate
第二VPS,我得到下面的輸出:未定義的方法`has_attached_file`使用Paperclip和Rails
[email protected]:/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!
An error has occurred, this and all later migrations canceled:
undefined method `has_attached_file' for #<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'
...
我到目前爲止已經完成設立第二個VPS是:
- 成立麒麟+ Nginx的(他們似乎是工作的罰款)
apt-get install git
apt-get install imagemagick
bundle install
(和回形針是我的Gemfile)- 重新啓動我的殼
- 重新啓動的VPS
這一切之後,我仍然得到上面的錯誤,每當我嘗試遷移。任何接下來要做什麼的想法?
哪個版本的回形針? –