新手问题 Ruby China 部署问题

juwell · 2014年09月18日 · 最后由 saiga 回复于 2014年09月19日 · 2251 次阅读

部署了之后,用户上传自定义头像后 RestClient::Forbidden in AccountController#update 直接 403 了,

应用报错服下,高手们帮忙看看呗! /usr/local/rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:81:in block in server' /usr/local/rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:intap' /usr/local/rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in server' /usr/local/rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:inrun_command!' /usr/local/rvm/gems/ruby-2.1.2/gems/railties-4.1.5/lib/rails/commands.rb:17:in <top (required)>' script/rails:6:inrequire'

script/rails:6:in `'

RestClient::Forbidden (403 Forbidden): app/models/user.rb:210:in update_with_password' app/controllers/account_controller.rb:13:inupdate'

Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.0ms) Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.6ms) Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.5ms) Rendered /usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (18.2ms)

我是部署在本地服务器,没有使用又拍云,难道非要使用又拍云存储图片的么?

没错,你得独立注册一个又拍云,然后替换对应的又拍配置项

可以不可以不用又拍云呢,那一段代码是啥,我是搞运维的,对 ruby 不熟

#3 楼 @juwell 看看 app/uploader 里面文件有类似 storage :upyun 的改成 storage :file 就行 (我猜的...没有具体看 ruby-china 的代码。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号