RubyMoney/money — Issue #126: Encoding::InvalidByteSequenceError on init in Rails 2.3.14 / Ruby 1.9.2
Author: masonhale
Created: 2011-11-25 19:21:45+00:00
State: open

When trying to launch a Rails 2.3.14 / Ruby 1.9.2 app (on Heroku) -- the app crashes on startup with the following stack trace:

```
2011-11-25T19:02:53+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/json-1.6.1/lib/json/common.rb:148:in `encode': "\xD8" on US-ASCII (Encoding::InvalidByteSequenceError)
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/json-1.6.1/lib/json/common.rb:148:in `initialize'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/json-1.6.1/lib/json/common.rb:148:in `new'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/json-1.6.1/lib/json/common.rb:148:in `parse'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/money-4.0.1/lib/money/currency_loader.rb:13:in `load_currencies'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/money-4.0.1/lib/money/currency.rb:27:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/money-4.0.1/lib/money/currency.rb:8:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/money-4.0.1/lib/money/currency.rb:5:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/money-4.0.1/lib/money.rb:26:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `block in require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/config/boot.rb:115:in `load_gems'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:164:in `process'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/config/environment.rb:9:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from :29:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from :29:in `require'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/rails.rb:42:in `load_application'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/rails.rb:23:in `initialize'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:29:in `new'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:29:in `block (3 levels) in

'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `instance_eval'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `initialize'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:63:in `new'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:63:in `map'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in

'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `instance_eval'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `initialize'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:11:in `new'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:11:in `block in

'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `instance_eval'
2011-11-25T19:02:53+00:00 app[web.1]:	from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.1.2/lib/rack/builder.rb:46:in `initialize'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T19:02:53+00:00 app[web.1]:	from /home/heroku_rack/heroku.ru:1:in `

'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:143:in `run!'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/bin/thin:6:in `'
2011-11-25T19:02:53+00:00 app[web.1]:	from /usr/ruby1.9.2/bin/thin:19:in `load'
```

Reverting back to money gem version 3.7.1 resolved the issue.