0

嗨,如果这是一个简单的问题,我深表歉意,因为我对编程还很陌生。这是一个 Ruby on Rails 应用程序。我有一个 API 正在侦听来自我们的供应商之一的推送通知。当供应商点击 API 时,我收到此错误:

     ==> log/beta.log <==
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (4.0.16) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  passenger (4.0.16) lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  passenger (4.0.16) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  passenger (4.0.16) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'



==> log/passenger.8009.log <==
  /home/pushprod/.rvm/gems/ruby-1.9.3-p392@email_mothership/gems/passenger-4.0.16/helper-scripts/rack-preloader.rb:28:in `<main>'

[ 2013-10-07 20:56:39.4455 25084/7f00f3286700 Pool2/Spawner.h:738 ]: [App 17120 stdout] 
[ 2013-10-07 20:56:54.2027 25084/7f00f3286700 Pool2/SmartSpawner.h:301 ]: Preloader for /usr/local/webapps/email_mothership started on PID 17120, listening on unix:/tmp/passenger.1.0.25079/generation-0/backends/preloader.17120
[ 2013-10-07 20:59:39.6995 25084/7f00f60b7700 Pool2/Spawner.h:738 ]: [App 17919 stdout] 
[ 2013-10-07 20:59:55.1740 25084/7f00f60b7700 Pool2/SmartSpawner.h:301 ]: Preloader for /usr/local/webapps/email_mothership started on PID 17919, listening on unix:/tmp/passenger.1.0.25079/generation-0/backends/preloader.17919
[ 2013-10-07 21:04:39.8805 25084/7f00f60f8700 Pool2/Spawner.h:738 ]: [App 19158 stdout] 
[ 2013-10-07 21:04:54.7856 25084/7f00f60f8700 Pool2/SmartSpawner.h:301 ]: Preloader for /usr/local/webapps/email_mothership started on PID 19158, listening on unix:/tmp/passenger.1.0.25079/generation-0/backends/preloader.19158
[ 2013-10-07 21:19:39.4375 25084/7f00f3286700 Pool2/Spawner.h:738 ]: [App 22742 stdout] 
[ 2013-10-07 21:19:52.9357 25084/7f00f3286700 Pool2/SmartSpawner.h:301 ]: Preloader for /usr/local/webapps/email_mothership started on PID 22742, listening on unix:/tmp/passenger.1.0.25079/generation-0/backends/preloader.22742

==> log/production.log <==
Connecting to database specified by database.yml
Connecting to database specified by database.yml

==> log/passenger.8009.log <==
[ 2013-10-07 22:03:39.3205 25084/7f00f60f8700 Pool2/Spawner.h:738 ]: [App 604 stdout] 

==> log/beta.log <==
Connecting to database specified by database.yml

==> log/passenger.8009.log <==
[ 2013-10-07 22:03:53.3365 25084/7f00f60f8700 Pool2/SmartSpawner.h:301 ]: Preloader for /usr/local/webapps/email_mothership started on PID 604, listening on unix:/tmp/passenger.1.0.25079/generation-0/backends/preloader.604

==> log/beta.log <==
Started POST "/" for 192.XXX.XXX at 2013-10-07 22:03:53 +0000
Error occurred while parsing request parameters.
Contents:



Encoding::InvalidByteSequenceError ("<?" on UTF-16):
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/encoding.rb:41:in `encode'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/encoding.rb:41:in `decode'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/source.rb:58:in `encoding='
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/source.rb:46:in `initialize'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/source.rb:162:in `initialize'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/source.rb:14:in `new'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/source.rb:14:in `create_from'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:127:in `stream='
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:116:in `initialize'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:9:in `new'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:9:in `initialize'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/document.rb:243:in `new'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/document.rb:243:in `build'
  /home/pushprod/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
  activesupport (3.2.13) lib/active_support/xml_mini/rexml.rb:30:in `new'
  activesupport (3.2.13) lib/active_support/xml_mini/rexml.rb:30:in `parse'
  activesupport (3.2.13) lib/active_support/xml_mini.rb:80:in `parse'
  activesupport (3.2.13) lib/active_support/core_ext/hash/conversions.rb:98:in `from_xml'
  actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:41:in `parse_formatted_parameters'
  actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:17:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__4098120160867524569__call__3041131689818678832__callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
  passenger (4.0.16) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  passenger (4.0.16) lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  passenger (4.0.16) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  passenger (4.0.16) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

看来编码可能是 UTF-16,我使用的是 UTF-8,但我可能离这里很远。任何帮助,将不胜感激。


原生 Android 浏览器的开发工具

我还没有为Android做太多的开发,我正在寻找在原生Android互联网浏览器(版本4.1.2)中调试一些JS/CSS。到目前为止,我已经在 Android 上找到了适用于 Chrome 的 ADB 扩展,但与原生浏览器相比并不多。

我看到我的 JS/CSS 中出现了一些奇怪的异常,出现在我在 Chrome 浏览器或 iOS 设备上看不到的原生 Android 浏览器中。

我正在寻找可用于在原生 Android 浏览器上调试 JS/CSS 的指导/建议/建议/工具。

谢谢!

4

2 回答 2

0

将 Ruby 设置为使用 UTF-8

export RUBYOPT=-Ku
于 2014-01-05T14:22:14.193 回答
0

如果 Zires 的反应不起作用,请尝试

string = string.force_encoding("UTF-8")

于 2014-01-05T14:27:36.227 回答