使用 wechat gem 包
deploy@iZ94ra5tl2iZ:~/weishop_deploy/current$ RAILS_ENV=production rake wechat:menu_create
rake aborted!
Wechat::ResponseError: invalid sub button key size(40026)
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/client.rb:42:in block in request'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/client.rb:70:in
parse_response'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/client.rb:31:in request'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/client.rb:19:in
post'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/api.rb:86:in block in post'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/api.rb:92:in
with_access_token'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/api.rb:86:in post'
/home/deploy/weishop_deploy/releases/290/vendor/bundle/ruby/2.1.0/bundler/gems/wechat-rails-5618101f1b41/lib/wechat/api.rb:37:in
menu_create'
/home/deploy/weishop_deploy/releases/290/lib/tasks/wechat.rake:7:in `block (2 levels) in '
Tasks: TOP => wechat:menu_create
(See full trace by running task with --trace)
点击类别的菜单设置了一个网址,超出了最大长度。
wechat_menu.yaml
把 click 改为 view 即可解决问题
杂记
PG::InFailedSqlTransaction at /admin/products/000/variants ERROR: current transaction is aborted, commands ignored until end of transaction block
google: PG::FeatureNotSupported: ERROR: cached plan must not change result type http://stackoverflow.com/questions/2783813/postgres-8-3-error-cached-plan-must-not-change-result-type 重启 rails 服务即可