更新到Heroku上不保存的配置文件

时间:2014-08-27 16:15:38

标签: ruby-on-rails ruby heroku devise

我更新了用户个人资料,以便他们现在可以在个人资料中添加个人资料。这一切都是使用Devise设置的。

一切都在本地工作正常但是当上传到Heroku时,我所做的更新并没有保存。如果我转到用户个人资料并尝试更新生物字段,则会显示消息"您已成功更新帐户。"但是,我回到我的帐户,生物还没有更新。

查看了Heroku日志,但似乎无法看到错误源自何处。

    heroku logs
2014-08-27T15:53:42.548525+00:00 app[web.1]: 
2014-08-27T15:54:22.190453+00:00 app[web.1]: Processing by Devise::RegistrationsController#edit as HTML
2014-08-27T15:54:22.351283+00:00 app[web.1]:   Rendered layouts/_header.html.erb (6.0ms)
2014-08-27T15:54:22.369810+00:00 app[web.1]: Completed 200 OK in 169ms (Views: 159.1ms | ActiveRecord: 1.6ms)
2014-08-27T15:53:42.548527+00:00 app[web.1]: 
2014-08-27T15:53:42.548524+00:00 app[web.1]:   app/views/devise/registrations/edit.html.erb:5:in `_app_views_devise_registrations_edit_html_erb__1928983160583724081_70011601502660'
2014-08-27T15:53:42.548522+00:00 app[web.1]:   app/views/devise/registrations/edit.html.erb:20:in `block in _app_views_devise_registrations_edit_html_erb__1928983160583724081_70011601502660'
2014-08-27T15:54:31.415029+00:00 app[web.1]: Started PUT "/users" for 88.150.202.202 at 2014-08-27 15:54:31 +0000
2014-08-27T15:54:31.550935+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.7ms)
2014-08-27T15:54:31.551733+00:00 app[web.1]: Completed 200 OK in 133ms (Views: 8.7ms | ActiveRecord: 3.6ms)
2014-08-27T15:54:31.418364+00:00 app[web.1]: Processing by Devise::RegistrationsController#update as HTML
2014-08-27T15:54:31.418419+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"TgCTObji/2GV1qfIk2RHwChFmgM0CUnoe685JPIX9Os=", "user"=>{"name"=>"Patrick's Chairs", "email"=>"patrick@frnsh.co.uk", "bio"=>"Established in 1990.", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "current_password"=>"[FILTERED]"}, "commit"=>"Update"}
2014-08-27T15:54:31.423532+00:00 app[web.1]: PG::FeatureNotSupported: ERROR:  cached plan must not change result type
2014-08-27T15:54:31.423536+00:00 app[web.1]: : SELECT  "users".* FROM "users"  WHERE "users"."id" = $1 LIMIT 1
2014-08-27T15:54:31.549502+00:00 app[web.1]:   Rendered devise/registrations/edit.html.erb within layouts/application (6.2ms)
2014-08-27T15:54:31.551447+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.3ms)
2014-08-27T15:53:42.546526+00:00 app[web.1]:   Rendered devise/registrations/edit.html.erb within layouts/application (5.6ms)
2014-08-27T15:53:42.548493+00:00 app[web.1]: 
2014-08-27T15:54:39.694397+00:00 heroku[router]: at=info method=POST path="/users" host=frnsh.herokuapp.com request_id=3df598cf-b036-454f-ac72-f82f4f061f1c fwd="88.150.202.202" dyno=web.1 connect=1ms service=183ms status=302 bytes=1471
2014-08-27T15:54:43.781382+00:00 app[web.1]: Started GET "/vendors/2/listings" for 88.150.202.202 at 2014-08-27 15:54:43 +0000
2014-08-27T15:54:39.922353+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:55:21.207841+00:00 app[web.1]: Started GET "/users/edit" for 88.150.202.202 at 2014-08-27 15:55:21 +0000
2014-08-27T15:54:45.893146+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T15:54:45.894409+00:00 app[web.1]: Completed 200 OK in 2017ms (Views: 2004.4ms | ActiveRecord: 4.3ms)
2014-08-27T15:55:21.222538+00:00 app[web.1]:   Rendered devise/registrations/edit.html.erb within layouts/application (7.9ms)
2014-08-27T15:55:21.224995+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.5ms)
2014-08-27T15:54:52.034601+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T15:54:52.035765+00:00 app[web.1]: Completed 200 OK in 1005ms (Views: 1000.3ms | ActiveRecord: 2.6ms)
2014-08-27T15:55:15.124819+00:00 heroku[router]: at=info method=GET path="/" host=frnsh.herokuapp.com request_id=f69f0226-2b3e-4055-8715-ccb3d4fcf9e4 fwd="88.150.202.202" dyno=web.1 connect=1ms service=3369ms status=304 bytes=1300
2014-08-27T15:54:22.184559+00:00 app[web.1]: Started GET "/users/edit" for 88.150.202.202 at 2014-08-27 15:54:22 +0000
2014-08-27T15:54:22.274881+00:00 app[web.1]:   Rendered devise/registrations/edit.html.erb within layouts/application (63.6ms)
2014-08-27T15:54:22.351865+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.3ms)
2014-08-27T15:55:11.167151+00:00 app[web.1]: Started PUT "/users" for 88.150.202.202 at 2014-08-27 15:55:11 +0000
2014-08-27T15:55:11.365097+00:00 app[web.1]: Completed 302 Found in 195ms (ActiveRecord: 12.9ms)
2014-08-27T15:55:11.763023+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:54:39.519920+00:00 app[web.1]: Processing by Devise::RegistrationsController#update as HTML
2014-08-27T15:54:39.519965+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"TgCTObji/2GV1qfIk2RHwChFmgM0CUnoe685JPIX9Os=", "user"=>{"name"=>"Patrick's Chairs", "email"=>"patrick@frnsh.co.uk", "bio"=>"Established in 1990.", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "current_password"=>"[FILTERED]"}, "commit"=>"Update"}
2014-08-27T15:54:39.689254+00:00 app[web.1]: Redirected to http://frnsh.herokuapp.com/
2014-08-27T15:54:41.378964+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.7ms)
2014-08-27T15:55:21.210544+00:00 app[web.1]: Processing by Devise::RegistrationsController#edit as HTML
2014-08-27T15:55:21.224329+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.7ms)
2014-08-27T15:55:21.225475+00:00 app[web.1]: Completed 200 OK in 15ms (Views: 11.8ms | ActiveRecord: 1.2ms)
2014-08-27T15:54:41.382440+00:00 app[web.1]: Completed 200 OK in 1460ms (Views: 1450.4ms | ActiveRecord: 7.5ms)
2014-08-27T15:54:51.030299+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:54:51.030307+00:00 app[web.1]:   Parameters: {"vendor_id"=>"2"}
2014-08-27T15:54:39.516642+00:00 app[web.1]: Started PUT "/users" for 88.150.202.202 at 2014-08-27 15:54:39 +0000
2014-08-27T15:54:39.689444+00:00 app[web.1]: Completed 302 Found in 168ms (ActiveRecord: 10.7ms)
2014-08-27T15:54:54.768259+00:00 heroku[router]: at=info method=GET path="/users/edit" host=frnsh.herokuapp.com request_id=e3dd3fa2-fa1b-40b3-9603-846755f41e17 fwd="88.150.202.202" dyno=web.1 connect=1ms service=19ms status=200 bytes=1137
2014-08-27T15:54:52.032715+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (998.0ms)
2014-08-27T15:54:52.035325+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.4ms)
2014-08-27T15:56:27.305893+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:56:11.945134+00:00 heroku[router]: at=info method=POST path="/users/sign_out" host=frnsh.herokuapp.com request_id=5cf03750-9e5c-4881-8fde-79c45aa79e16 fwd="88.150.202.202" dyno=web.1 connect=1ms service=18ms status=302 bytes=1282
2014-08-27T15:55:17.567881+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:55:11.760136+00:00 app[web.1]: Started GET "/" for 88.150.202.202 at 2014-08-27 15:55:11 +0000
2014-08-27T15:55:18.639706+00:00 app[web.1]:   Rendered layouts/_header.html.erb (1.0ms)
2014-08-27T15:55:15.099044+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (3327.5ms)
2014-08-27T15:55:15.115501+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.3ms)
2014-08-27T15:55:15.111230+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T15:55:15.116236+00:00 app[web.1]: Completed 200 OK in 3350ms (Views: 3335.1ms | ActiveRecord: 13.2ms)
2014-08-27T15:55:18.640676+00:00 app[web.1]: Completed 200 OK in 1071ms (Views: 1060.3ms | ActiveRecord: 5.4ms)
2014-08-27T15:56:12.392430+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:56:47.170713+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.5ms)
2014-08-27T15:56:14.001538+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.4ms)
2014-08-27T15:56:14.002454+00:00 app[web.1]: Completed 200 OK in 1610ms (Views: 1603.3ms | ActiveRecord: 4.6ms)
2014-08-27T15:56:24.434839+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T15:56:24.509393+00:00 app[web.1]: Completed 200 OK in 1495ms (Views: 1486.5ms | ActiveRecord: 6.3ms)
2014-08-27T15:56:24.433386+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (1415.5ms)
2014-08-27T15:56:24.508725+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (73.4ms)
2014-08-27T15:56:23.012166+00:00 app[web.1]: Started GET "/" for 88.150.202.202 at 2014-08-27 15:56:23 +0000
2014-08-27T15:56:28.366087+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T15:56:28.370378+00:00 app[web.1]: Completed 200 OK in 1058ms (Views: 1017.4ms | ActiveRecord: 25.7ms)
2014-08-27T15:56:31.819357+00:00 app[web.1]: Processing by Devise::RegistrationsController#edit as HTML
2014-08-27T15:56:31.833761+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.7ms)
2014-08-27T15:56:31.834471+00:00 app[web.1]: Completed 200 OK in 15ms (Views: 8.5ms | ActiveRecord: 1.3ms)
2014-08-27T15:56:47.169292+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (1043.0ms)
2014-08-27T15:56:47.171690+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.4ms)
2014-08-27T15:56:47.171834+00:00 app[web.1]: Completed 200 OK in 1073ms (Views: 1049.7ms | ActiveRecord: 6.2ms)
2014-08-27T15:56:11.926879+00:00 app[web.1]: Started DELETE "/users/sign_out" for 88.150.202.202 at 2014-08-27 15:56:11 +0000
2014-08-27T15:56:11.929998+00:00 app[web.1]: Processing by Devise::SessionsController#destroy as HTML
2014-08-27T15:56:11.930022+00:00 app[web.1]:   Parameters: {"authenticity_token"=>"TgCTObji/2GV1qfIk2RHwChFmgM0CUnoe685JPIX9Os="}
2014-08-27T15:56:11.940178+00:00 app[web.1]: Redirected to http://frnsh.herokuapp.com/
2014-08-27T15:56:11.940333+00:00 app[web.1]: Completed 302 Found in 10ms (ActiveRecord: 2.6ms)
2014-08-27T15:56:23.014719+00:00 app[web.1]: Processing by ListingsController#index as HTML
2014-08-27T15:55:21.245141+00:00 heroku[router]: at=info method=GET path="/users/edit" host=frnsh.herokuapp.com request_id=d0ff6ceb-b122-49a4-81fb-f19f47af5159 fwd="88.150.202.202" dyno=web.1 connect=59ms service=30ms status=304 bytes=1158
2014-08-27T15:55:18.646548+00:00 heroku[router]: at=info method=GET path="/vendors/2/listings" host=frnsh.herokuapp.com request_id=2ee8b1f0-1e83-4ed4-9f79-db2d4ab09b20 fwd="88.150.202.202" dyno=web.1 connect=3ms service=1086ms status=304 bytes=1299
2014-08-27T15:56:41.100700+00:00 app[web.1]: Started GET "/" for 88.150.202.202 at 2014-08-27 15:56:41 +0000
2014-08-27T15:56:49.537748+00:00 app[web.1]: Processing by Devise::RegistrationsController#edit as HTML
2014-08-27T15:56:49.557637+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.7ms)
2014-08-27T15:56:49.558682+00:00 app[web.1]: Completed 200 OK in 21ms (Views: 12.4ms | ActiveRecord: 5.2ms)
2014-08-27T15:55:54.720242+00:00 heroku[router]: at=info method=GET path="/users/edit" host=frnsh.herokuapp.com request_id=52ceb1bb-5808-40b9-82fd-c9e4da7a0915 fwd="88.150.202.202" dyno=web.1 connect=7ms service=94ms status=200 bytes=1150
2014-08-27T15:56:24.512579+00:00 heroku[router]: at=info method=GET path="/" host=frnsh.herokuapp.com request_id=bf7cbaeb-bfc8-459e-bfcd-ffe8e515d88d fwd="88.150.202.202" dyno=web.1 connect=1ms service=1504ms status=200 bytes=1160
2014-08-27T15:56:22.578880+00:00 heroku[router]: at=info method=POST path="/users/sign_in" host=frnsh.herokuapp.com request_id=a86a31c1-ab21-4eda-9f11-b6640bef0cfd fwd="88.150.202.202" dyno=web.1 connect=1ms service=157ms status=302 bytes=1276
2014-08-27T15:56:28.376839+00:00 heroku[router]: at=info method=GET path="/vendors/2/listings" host=frnsh.herokuapp.com request_id=0dc25dfa-5636-411b-8bd2-fbd4ae97cd6f fwd="88.150.202.202" dyno=web.1 connect=2ms service=1212ms status=200 bytes=1279
2014-08-27T15:56:49.560503+00:00 heroku[router]: at=info method=GET path="/users/edit" host=frnsh.herokuapp.com request_id=13fb4e09-c563-406a-be6f-1a939c751ec9 fwd="88.150.202.202" dyno=web.1 connect=1ms service=34ms status=304 bytes=1157
2014-08-27T15:56:42.639325+00:00 heroku[router]: at=info method=GET path="/" host=frnsh.herokuapp.com request_id=b3a53e92-c663-49b6-b168-6efad61db54c fwd="88.150.202.202" dyno=web.1 connect=1ms service=1543ms status=200 bytes=1300
2014-08-27T15:56:47.181104+00:00 heroku[router]: at=info method=GET path="/vendors/2/listings" host=frnsh.herokuapp.com request_id=272f6a86-ff34-4699-a364-fd9e26cfac38 fwd="88.150.202.202" dyno=web.1 connect=4ms service=1092ms status=304 bytes=1299
2014-08-27T16:01:15.323746+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=frnsh.herokuapp.com request_id=cf38ec59-913e-4cfd-ade1-12ba96042879 fwd="50.163.139.118" dyno=web.1 connect=4ms service=5ms status=200 bytes=842
2014-08-27T16:00:47.061078+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (1511.9ms)
2014-08-27T16:00:47.065668+00:00 app[web.1]:   Rendered layouts/_footer.html.erb (0.3ms)
2014-08-27T16:00:47.064197+00:00 app[web.1]:   Rendered layouts/_header.html.erb (0.6ms)
2014-08-27T16:00:47.066061+00:00 app[web.1]: Completed 200 OK in 1520ms (Views: 1501.9ms | ActiveRecord: 16.6ms)

用户模型(user.rb)

class User < ActiveRecord::Base

     if Rails.env.development?
        has_attached_file :image, :styles => { :medium => "200x200", :thumb => "100x100>" }, :default_url => "default.jpg"
     else
        has_attached_file :image, :styles => { :medium => "200x200", :thumb => "100x100>" }, :default_url => "default.jpg",
        :storage => :dropbox,
        :dropbox_credentials => Rails.root.join("config/dropbox.yml"),
        :path => ":style/:id_:filename"
     end

    validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png"]

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

   validates :name, presence: true

   has_many :listings, dependent: :destroy
   has_many :sales, class_name: "Order", foreign_key: "seller_id"
   has_many :purchases, class_name: "Order", foreign_key: "buyer_id" 

end

0 个答案:

没有答案