ImageScience w/ Rails 3 - ruby-on-rails

I'm trying to get ImageScience working w/ my rails 3 app. When I try to do require 'image_science' in one of my controllers I get:
LoadError in Api::ImagesController#server
require on /Users/Kyle/.ruby_inline/Inline_ImageScience_cdab.bundle failed
This error occurred while loading the following files:
image_science
Full Trace
RubyInline (3.9.0) lib/inline.rb:513:in `load'
RubyInline (3.9.0) lib/inline.rb:829:in `inline'
image_science (1.2.1) lib/image_science.rb:90:in `<class:ImageScience>'
image_science (1.2.1) lib/image_science.rb:13:in `<top (required)>'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `block in require'
activesupport (3.0.7) lib/active_support/dependencies.rb:225:in `block in load_dependency'
activesupport (3.0.7) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.7) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.7) lib/active_support/dependencies.rb:239:in `require'
app/controllers/api/images_controller.rb:3:in `<top (required)>'
activesupport (3.0.7) lib/active_support/dependencies.rb:454:in `load'
activesupport (3.0.7) lib/active_support/dependencies.rb:454:in `block in load_file'
activesupport (3.0.7) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.7) lib/active_support/dependencies.rb:453:in `load_file'
activesupport (3.0.7) lib/active_support/dependencies.rb:340:in `require_or_load'
activesupport (3.0.7) lib/active_support/dependencies.rb:491:in `load_missing_constant'
activesupport (3.0.7) lib/active_support/dependencies.rb:183:in `block in const_missing'
activesupport (3.0.7) lib/active_support/dependencies.rb:181:in `each'
activesupport (3.0.7) lib/active_support/dependencies.rb:181:in `const_missing'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:124:in `block in constantize'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:123:in `each'
activesupport (3.0.7) lib/active_support/inflector/methods.rb:123:in `constantize'
activesupport (3.0.7) lib/active_support/dependencies.rb:528:in `block in <class:Reference>'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `yield'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `default'
activesupport (3.0.7) lib/active_support/dependencies.rb:538:in `get'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:58:in `controller_reference'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:23:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:89:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/builder.rb:30:in `call'
sass (3.1.3) lib/sass/plugin/rack.rb:54:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
flash_cookie_session (1.1.1) lib/flash_cookie_session/middleware.rb:18:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/chunked.rb:15:in `call'
thin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'
thin (1.2.11) lib/thin/connection.rb:82:in `catch'
thin (1.2.11) lib/thin/connection.rb:82:in `pre_process'
thin (1.2.11) lib/thin/connection.rb:57:in `process'
thin (1.2.11) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.11) lib/thin/backends/base.rb:61:in `start'
thin (1.2.11) lib/thin/server.rb:159:in `start'
rack (1.2.3) lib/rack/handler/thin.rb:14:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.7) lib/rails/commands/server.rb:65:in `start'
railties (3.0.7) lib/rails/commands.rb:30:in `block in <top (required)>'
railties (3.0.7) lib/rails/commands.rb:27:in `tap'
railties (3.0.7) lib/rails/commands.rb:27:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

Related

RubyOnRails: SQL injection causes ActionController::BadRequest which cannot be handled

I am getting SQL-injection url requests such as: ?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=12345.php&vars[1][1]=
which is causing a:
ActionController::BadRequest (Invalid query parameters: expected Hash (got Array) for param `1'):
in my home#index. I believe the error is caught in a middleware or routing as I cannot catch the error in the home#index controller (or application controller either).
This is my development log response to the url:
ActionController::BadRequest (Invalid query parameters: expected Hash (got Array) for param `1'):
rack (1.6.11) lib/rack/utils.rb:162:in `normalize_params'
rack (1.6.11) lib/rack/utils.rb:163:in `normalize_params'
rack (1.6.11) lib/rack/utils.rb:122:in `block in parse_nested_query'
rack (1.6.11) lib/rack/utils.rb:119:in `each'
rack (1.6.11) lib/rack/utils.rb:119:in `parse_nested_query'
rack (1.6.11) lib/rack/request.rb:371:in `parse_query'
actionpack (4.2.10) lib/action_dispatch/http/request.rb:339:in `parse_query'
rack (1.6.11) lib/rack/request.rb:191:in `GET'
actionpack (4.2.10) lib/action_dispatch/http/request.rb:300:in `GET'
actionpack (4.2.10) lib/action_dispatch/http/parameters.rb:14:in `parameters'
actionpack (4.2.10) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters'
actionpack (4.2.10) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.10) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.10) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.10) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.10) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:817:in `call'
bullet (6.0.2) lib/bullet/rack.rb:12:in `call'
rack (1.6.11) lib/rack/etag.rb:24:in `call'
rack (1.6.11) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.11) lib/rack/head.rb:13:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.11) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.11) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.10) lib/active_record/query_cache.rb:36:in `call'
airbrake (9.4.3) lib/airbrake/rack/middleware.rb:32:in `call!'
airbrake (9.4.3) lib/airbrake/rack/middleware.rb:21:in `call'
activerecord (4.2.10) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.10) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.10) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.10) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.10) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.10) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `call'
request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.11) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.11) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.10) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.11) lib/rack/lock.rb:17:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.11) lib/rack/sendfile.rb:113:in `call'
utf8-cleaner (0.2.5) lib/utf8-cleaner/middleware.rb:21:in `call'
railties (4.2.10) lib/rails/engine.rb:518:in `call'
railties (4.2.10) lib/rails/application.rb:165:in `call'
rack (1.6.11) lib/rack/content_length.rb:15:in `call'
thin (1.7.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.7.2) lib/thin/connection.rb:84:in `catch'
thin (1.7.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.7.2) lib/thin/connection.rb:53:in `process'
thin (1.7.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run_machine'
eventmachine (1.2.7) lib/eventmachine.rb:195:in `run'
thin (1.7.2) lib/thin/backends/base.rb:73:in `start'
thin (1.7.2) lib/thin/server.rb:162:in `start'
rack (1.6.11) lib/rack/handler/thin.rb:19:in `run'
rack (1.6.11) lib/rack/server.rb:287:in `start'
railties (4.2.10) lib/rails/commands/server.rb:80:in `start'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:80:in `block in server'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:75:in `tap'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:75:in `server'
railties (4.2.10) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
railties (4.2.10) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<top (required)>'
spring (2.1.0) lib/spring/client/rails.rb:28:in `load'
spring (2.1.0) lib/spring/client/rails.rb:28:in `call'
spring (2.1.0) lib/spring/client/command.rb:7:in `call'
spring (2.1.0) lib/spring/client.rb:30:in `run'
spring (2.1.0) bin/spring:49:in `<top (required)>'
spring (2.1.0) lib/spring/binstub.rb:11:in `load'
spring (2.1.0) lib/spring/binstub.rb:11:in `<top (required)>'
bin/spring:13:in `require'
bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
How can I make sure these spam/sql inject-requests are being handled so they don't cause exceptions?
In Your Application Controller:
rescue_from ActionController::BadRequest, with: :bad_request
def bad_request(exception)
render status: 400, json: {:error => exception.message}.to_json
end
I came across this same issue this evening. The error is being thrown before ApplicationController begins to handle the request so catching it in ApplicationController won't work because it's too late.
What you need to do is insert a piece of middleware that catches ActionController::BadRequest before the ActionDispatch::ParamsParser middleware which is throwing the error.
Example which catches the error, adds it to the log and then returns a plain text 400 page.
# app/middleware/catch_batch_request_error_mw.rb
class CatchBadRequestErrorMw
def initialize(app)
#app = app
end
def call(env)
begin
#app.call(env)
rescue ActionController::BadRequest => e
Rails.logger.error("CatchBadRequestErrorMw: #{e.message}")
return [
400,
{
'Content-Type': 'text/plain',
},
['Bad Request']
]
end
end
end
And then in Application.rb
config.middleware.insert_before(ActionDispatch::ParamsParser, CatchBadRequestErrorMw)
I should note that the examples here are from a Rails 4.2 app so if you have any issues I'd start there.

Rails 5 Action Controller Routing error when I remove helper

I am getting the following error when I remove a helper for a corresponding controller:
Couldn't find CompaniesHelper, expected it to be defined in helpers/companies_helper.rb
Application Trace | Framework Trace | Full Trace
app/controllers/companies_controller.rb:1:in `<main>'
I am confused by this as I didn't think the companies_controller was dependent on having a helper. Maybe I am wrong in this assumption?
I have tried in my development.rb to remove including the helpers which hasn't worked.
Any help would be appreciated!
Thanks
EDIT
Full stack trace:
Rails.root: /Users/Richard/Code/whisper
Application Trace | Framework Trace | Full Trace
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:162:in `rescue in block in modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:155:in `block in modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:144:in `map!'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers'
actionpack (5.2.0.rc2) lib/action_controller/metal/helpers.rb:94:in `modules_for_helpers'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:108:in `helper'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:186:in `default_helper_module!'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `block in inherited'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `class_eval'
actionpack (5.2.0.rc2) lib/abstract_controller/helpers.rb:35:in `inherited'
actionview (5.2.0.rc2) lib/action_view/layouts.rb:219:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/rendering.rb:23:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/parameter_encoding.rb:10:in `inherited'
actionpack (5.2.0.rc2) lib/action_controller/metal/params_wrapper.rb:237:in `inherited'
actionpack (5.2.0.rc2) lib/abstract_controller/railties/routes_helpers.rb:9:in `block (2 levels) in with'
actionpack (5.2.0.rc2) lib/action_controller/railties/helpers.rb:7:in `inherited'
app/controllers/companies_controller.rb:1:in `<main>'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:468:in `block in load_file'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:653:in `new_constants_in'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:467:in `load_file'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:365:in `block in require_or_load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.0.rc2) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.0.rc2) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.0.rc2) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:348:in `require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:502:in `load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:193:in `const_missing'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:283:in `const_get'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:283:in `block in constantize'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `each'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `inject'
activesupport (5.2.0.rc2) lib/active_support/inflector/methods.rb:281:in `constantize'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:574:in `get'
activesupport (5.2.0.rc2) lib/active_support/dependencies.rb:605:in `constantize'
actionpack (5.2.0.rc2) lib/action_dispatch/http/request.rb:88:in `controller_class_for'
actionpack (5.2.0.rc2) lib/action_dispatch/http/request.rb:81:in `controller_class'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:46:in `controller'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.0.rc2) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.0.rc2) lib/action_dispatch/routing/route_set.rb:840:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.0.6) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.6) lib/rack/etag.rb:25:in `call'
rack (2.0.6) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.6) lib/rack/head.rb:12:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.6) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.6) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.0.rc2) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.0.rc2) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.0.rc2) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.0.rc2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.0.rc2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0.rc2) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
webpacker (3.5.5) lib/webpacker/dev_server_proxy.rb:22:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (5.2.0.rc2) lib/rails/engine.rb:524:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'
For Rails 5+, By default, each controller will include all helpers.
Pre Rails 5, the controller would include a helper matched to its name. Making the setting as specified above returns to the Pre-Rails 5 behavior.
To set Pre-Rails-5 behaviour of helpers, set in config/development.rb
config.action_controller.include_all_helpers = false

PayPal REST API OAuth Response error

i am trying the PayPal REST API for Ruby on Rails, i am following the example "OAuth Request / Response" from https://developer.paypal.com/webapps/developer/docs/api/ for Ruby:
class PaymentsController < ApplicationController
include PayPal::SDK::REST
def pay
#api = PayPal::SDK::REST.set_config(
:ssl_options => {}, # Set ssl options
:mode => :sandbox, # Set :sandbox or :live
:client_id => "XXXXXXXXXXX",
:client_secret => "XXXXXXXXXXX" )
#api.token
end
end
And i don't know why, but i receive the next error.
LoadError in PaymentsController#pay
no such file to load -- {"scope":"openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/developer/.*","access_token":"Mnlhn0RcJ9KWQTU6z5-cH5iDu8aeMzOM7TACw1NhFp0","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}
full trace
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `load'
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `block in load'
activesupport (3.0.20) lib/active_support/dependencies.rb:225:in `block in load_dependency'
activesupport (3.0.20) lib/active_support/dependencies.rb:597:in `new_constants_in'
activesupport (3.0.20) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.20) lib/active_support/dependencies.rb:236:in `load'
paypal-sdk-core (0.2.6) lib/paypal-sdk/core/api/rest.rb:58:in `token_hash'
paypal-sdk-core (0.2.6) lib/paypal-sdk/core/api/rest.rb:65:in `token'
app/controllers/payments_controller.rb:15:in `pay'
actionpack (3.0.20) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.20) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.20) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.20) lib/active_support/callbacks.rb:456:in `_run__1063560453__process_action__391973748__callbacks'
activesupport (3.0.20) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.20) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.20) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.20) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.20) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.20) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.20) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.20) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in `block in perform_action_with_newrelic_trace'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/method_tracer.rb:240:in `trace_execution_scoped'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.5.6.55) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.0.20) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.20) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.20) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.20) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.20) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:68:in `call'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.20) lib/action_dispatch/routing/route_set.rb:499:in `call'
oink (0.9.3) lib/oink/middleware.rb:17:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/error_collector.rb:8:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/agent_hooks.rb:14:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/browser_monitoring.rb:12:in `call'
newrelic_rpm (3.5.6.55) lib/new_relic/rack/developer_mode.rb:24:in `call'
warden (1.0.6) lib/warden/manager.rb:35:in `block in call'
warden (1.0.6) lib/warden/manager.rb:34:in `catch'
warden (1.0.6) lib/warden/manager.rb:34:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.7) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.20) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.20) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.20) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.20) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.20) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.20) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.20) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.7) lib/rack/sendfile.rb:106:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.20) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.7) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.20) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.7) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.7) lib/rack/lock.rb:13:in `call'
actionpack (3.0.20) lib/action_dispatch/middleware/static.rb:30:in `call'
airbrake (3.1.6) lib/airbrake/rack.rb:41:in `call'
airbrake (3.1.6) lib/airbrake/user_informer.rb:12:in `call'
railties (3.0.20) lib/rails/application.rb:168:in `call'
railties (3.0.20) lib/rails/application.rb:77:in `method_missing'
railties (3.0.20) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.7) lib/rack/content_length.rb:13:in `call'
rack (1.2.7) lib/rack/handler/webrick.rb:52:in `service'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/jorge/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
This error occurred while loading the following files:
{"scope":"openid https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card/.* https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/developer/.*","access_token":"Mnlhn0RcJ9KWQTU6z5-cH5iDu8aeMzOM7TACw1NhFp0","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}
SOLVED: update the multi_json gem to last version.
update the multi_json gem to last version.

superclass mismatch for class HTTP on mac os X

I'm having some troubles installing my Ruby on Rails environment on my Mac, I'm trying with this versions:
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.7.1]
gem 1.8.6
Snow Leopard 10.6.8
I think that XCode by default installs some ruby libraries that are in conflict with some of my gems. To install ruby I have used "rvm install 1.8.7"
This is the error's stack trace:
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/net/http.rb:278
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/net/https.rb:101
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:454:in `load'
activesupport (3.0.3) lib/active_support/dependencies.rb:454:in `load_file'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:453:in `load_file'
activesupport (3.0.3) lib/active_support/dependencies.rb:340:in `require_or_load'
activesupport (3.0.3) lib/active_support/dependencies.rb:491:in `load_missing_constant'
activesupport (3.0.3) lib/active_support/dependencies.rb:183:in `const_missing'
activesupport (3.0.3) lib/active_support/dependencies.rb:181:in `each'
activesupport (3.0.3) lib/active_support/dependencies.rb:181:in `const_missing'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:113:in `constantize'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:112:in `each'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:112:in `constantize'
activesupport (3.0.3) lib/active_support/dependencies.rb:528
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `call'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `default'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `[]'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `get'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:58:in `controller_reference'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:23:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `send'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/handler/webrick.rb:52:in `service'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.3) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.3) lib/rails/commands/server.rb:65:in `start'
railties (3.0.3) lib/rails/commands.rb:30
railties (3.0.3) lib/rails/commands.rb:27:in `tap'
railties (3.0.3) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Thanks in advance,
Raimon Bosch.
In the end we found another class in the repository with the same name:
cd $HOME/.rvm/gems
find . -name *.rb | xargs grep 'class HTTP'
Then we see an HTTP class on net.ssh-2.1.4
./ruby-1.8.7-p352/gems/net-ssh-2.1.4/lib/net/ssh/proxy/http.rb: class HTTP
To solve the problem we forced the require 'net/http' and require 'net/https' at the beginning of the application. If the aplication requires the default gems is requiring first the HTTP class of net-ssh-2.1.4 and then we are not able to use Net:HTTP.

can't define singleton method "encode_with" for BigDecimal

When trying to update one of my models I get the exception can't define singleton method "encode_with" for BigDecimal. I am using Rails 3.0.7 & Ruby 1.9.2.
SkateparksController
def update
#skatepark.update_attributes(params[:skatepark])
end
Full Trace
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/deprecated.rb:16:in `singleton_method_added'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/deprecated.rb:16:in `define_method'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/deprecated.rb:16:in `quick_emit'
activesupport (3.0.7) lib/active_support/core_ext/big_decimal/conversions.rb:15:in `to_yaml'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:55:in `accept'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:227:in `block in visit_Hash'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `each'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `visit_Hash'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:63:in `accept'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:36:in `<<'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:165:in `dump'
rspec-mocks (2.6.0) lib/rspec/mocks/extensions/psych.rb:5:in `dump_with_mocks'
/Users/Kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
paper_trail (2.2.5) lib/paper_trail/has_paper_trail.rb:158:in `object_to_string'
paper_trail (2.2.5) lib/paper_trail/has_paper_trail.rb:113:in `record_update'
activesupport (3.0.7) lib/active_support/callbacks.rb:415:in `_run_update_callbacks'
activerecord (3.0.7) lib/active_record/callbacks.rb:281:in `update'
activerecord (3.0.7) lib/active_record/persistence.rb:246:in `create_or_update'
activerecord (3.0.7) lib/active_record/callbacks.rb:273:in `block in create_or_update'
activesupport (3.0.7) lib/active_support/callbacks.rb:444:in `_run_save_callbacks'
activerecord (3.0.7) lib/active_record/callbacks.rb:273:in `create_or_update'
activerecord (3.0.7) lib/active_record/persistence.rb:39:in `save'
activerecord (3.0.7) lib/active_record/validations.rb:43:in `save'
activerecord (3.0.7) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block (2 levels) in save'
activerecord (3.0.7) lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:207:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block in save'
activerecord (3.0.7) lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
activerecord (3.0.7) lib/active_record/transactions.rb:239:in `save'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:245:in `block in update_address'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:9:in `without_callback'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:244:in `update_address'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:218:in `block in attach_geocode'
activesupport (3.0.7) lib/active_support/callbacks.rb:414:in `_run_geocoding_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:216:in `attach_geocode'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:151:in `block in validates_as_geocodable'
activesupport (3.0.7) lib/active_support/callbacks.rb:470:in `_run_validate_callbacks'
activemodel (3.0.7) lib/active_model/validations.rb:212:in `run_validations!'
activemodel (3.0.7) lib/active_model/validations/callbacks.rb:67:in `block in run_validations!'
activesupport (3.0.7) lib/active_support/callbacks.rb:424:in `_run_validation_callbacks'
activemodel (3.0.7) lib/active_model/validations/callbacks.rb:67:in `run_validations!'
activemodel (3.0.7) lib/active_model/validations.rb:179:in `valid?'
activerecord (3.0.7) lib/active_record/validations.rb:55:in `valid?'
activerecord (3.0.7) lib/active_record/validations.rb:75:in `perform_validations'
activerecord (3.0.7) lib/active_record/validations.rb:43:in `save'
activerecord (3.0.7) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block (2 levels) in save'
activerecord (3.0.7) lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:207:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block in save'
activerecord (3.0.7) lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
activerecord (3.0.7) lib/active_record/transactions.rb:239:in `save'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:245:in `block in update_address'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:9:in `without_callback'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:244:in `update_address'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:218:in `block in attach_geocode'
activesupport (3.0.7) lib/active_support/callbacks.rb:414:in `_run_geocoding_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:216:in `attach_geocode'
acts_as_geocodable (2.0.2) lib/acts_as_geocodable.rb:151:in `block in validates_as_geocodable'
activesupport (3.0.7) lib/active_support/callbacks.rb:470:in `_run_validate_callbacks'
activemodel (3.0.7) lib/active_model/validations.rb:212:in `run_validations!'
activemodel (3.0.7) lib/active_model/validations/callbacks.rb:67:in `block in run_validations!'
activesupport (3.0.7) lib/active_support/callbacks.rb:424:in `_run_validation_callbacks'
activemodel (3.0.7) lib/active_model/validations/callbacks.rb:67:in `run_validations!'
activemodel (3.0.7) lib/active_model/validations.rb:179:in `valid?'
activerecord (3.0.7) lib/active_record/validations.rb:55:in `valid?'
activerecord (3.0.7) lib/active_record/validations.rb:75:in `perform_validations'
activerecord (3.0.7) lib/active_record/validations.rb:43:in `save'
activerecord (3.0.7) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block (2 levels) in save'
activerecord (3.0.7) lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:207:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/transactions.rb:240:in `block in save'
activerecord (3.0.7) lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
activerecord (3.0.7) lib/active_record/transactions.rb:239:in `save'
activerecord (3.0.7) lib/active_record/persistence.rb:128:in `block in update_attributes'
activerecord (3.0.7) lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:207:in `transaction'
activerecord (3.0.7) lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
activerecord (3.0.7) lib/active_record/persistence.rb:126:in `update_attributes'
app/controllers/admin/skateparks_controller.rb:54:in `update'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.7) lib/active_support/callbacks.rb:472:in `block in _run__3889911993370107397__process_action__388168845574438513__callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:221:in `block in _conditional_callback_around_218'
activesupport (3.0.7) lib/active_support/callbacks.rb:331:in `around'
activesupport (3.0.7) lib/active_support/callbacks.rb:315:in `_callback_around_33'
activesupport (3.0.7) lib/active_support/callbacks.rb:220:in `_conditional_callback_around_218'
activesupport (3.0.7) lib/active_support/callbacks.rb:436:in `_run__3889911993370107397__process_action__388168845574438513__callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.7) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:82:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.2.6) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.2.6) lib/omniauth/builder.rb:30:in `call'
sass (3.1.3) lib/sass/plugin/rack.rb:54:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
flash_cookie_session (1.1.1) lib/flash_cookie_session/middleware.rb:18:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/chunked.rb:15:in `call'
thin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'
thin (1.2.11) lib/thin/connection.rb:82:in `catch'
thin (1.2.11) lib/thin/connection.rb:82:in `pre_process'
thin (1.2.11) lib/thin/connection.rb:57:in `process'
thin (1.2.11) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.11) lib/thin/backends/base.rb:61:in `start'
thin (1.2.11) lib/thin/server.rb:159:in `start'
rack (1.2.3) lib/rack/handler/thin.rb:14:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.7) lib/rails/commands/server.rb:65:in `start'
railties (3.0.7) lib/rails/commands.rb:30:in `block in <top (required)>'
railties (3.0.7) lib/rails/commands.rb:27:in `tap'
railties (3.0.7) lib/rails/commands.rb:27:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
It might be because of a YAML parser error. I had a similar error which I fixed using the following code:
#in config/boot.rb
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler= 'syck'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
......
I have seen this error in ubuntu 10.10+ machines
I had a similar problem using jruby 1.6.5, ruby 1.9 and rails 2.3.14 on windows
$ jruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [Windows 7-amd64-java]
I was able to get around this by looking at the fix for rails 3. All I had to do was to add a file (I called it fix_big_decimal.rb) to my config/initializers:
module ActiveSupport
module CoreExtensions
module BigDecimal
module Conversions
def encode_with(coder)
string = to_s
coder.represent_scalar(nil, YAML_MAPPING[string] || string)
end
# Backport this method if it doesn't exist
unless method_defined?(:to_d)
def to_d
self
end
end
end
end
end
end

Resources