Imppossible to restore configuration with backup - sonarqube

I have installed a sonar's test serveur (same version, plugins, os, ... than the production) to test some Sonar upgrades.
I use the backup / restore function.
Everything work fine except for the quality profiles which do errors on the test serveur.
The logs when I restore backuped files :
o.s.s.c.MetricsBackup Disable user-defined metrics
o.s.s.c.MetricsBackup Restore metrics
o.s.s.c.PropertiesBackup Restore properties
o.s.s.c.RulesBackup Disable rules created by user
o.s.s.c.RulesBackup Restore rules
o.s.s.c.ProfilesBackup Delete profiles
o.s.s.c.ProfilesBackup Restore profile SIHM - Général
o.s.s.c.ProfilesBackup Restore profile SIHM - Général
o.s.s.c.ProfilesBackup Restore profile SIHM - Général
o.s.s.c.ProfilesBackup Restore profile SIHM - Général
o.s.s.c.ProfilesBackup Restore profile SIHM - Projets Intranet
o.s.s.c.ProfilesBackup Restore profile SIHM - Projets Intranet
o.s.s.c.ProfilesBackup Restore profile Sonar way with Findbugs
o.s.s.c.ProfilesBackup Restore profile Sonar way
o.s.s.c.ProfilesBackup Restore profile Sun checks
o.s.s.c.ProfilesBackup Restore profile Sonar way
o.s.s.c.ProfilesBackup Restore profile Sonar way
o.s.s.c.ProfilesBackup Restore profile Sonar way
o.s.s.c.ProfilesBackup Restore profile SIHM - Projets EAR
o.s.s.c.Backup Backup restored
The errors when I try to access to the enterprise quality profils (SIHM - xxxxx) :
ERROR o.s.s.ui.JRubyFacade Fail to render: http://xxxxx:9000/rules_configuration/index/10020
undefined method `strip' for nil:NilClass
On line #11 of app/views/rules_configuration/_rule_note.html.erb
8: %>
9: <div id="<%= note_detail_div_id -%>">
10: <div>
11: <% if rule.description.strip.start_with?('<p>') %>
12: <%= Internal.text.interpretMacros(rule.description) %>
13: <% else %>
14: <p><%= Internal.text.interpretMacros(rule.description) %></p>
app/views/rules_configuration/_rule_note.html.erb:11
org/jruby/RubyKernel.java:2109:in `send'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:34:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:306:in `with_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:30:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:20:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:30:in `benchmark'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:19:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/template.rb:205:in `render_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:44:in `render_partial'
gems/gems/actionpack-2.3.15/lib/action_view/partials.rb:184:in `render_partial'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:267:in `render'
app/views/rules_configuration/_rule.html.erb:46
org/jruby/RubyKernel.java:2109:in `send'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:34:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:306:in `with_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:30:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:20:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:30:in `benchmark'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:19:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/template.rb:205:in `render_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable_partial.rb:44:in `render_partial'
gems/gems/actionpack-2.3.15/lib/action_view/partials.rb:184:in `render_partial'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:267:in `render'
app/views/rules_configuration/index.html.erb:158
org/jruby/RubyArray.java:1620:in `each'
app/views/rules_configuration/index.html.erb:154
org/jruby/RubyKernel.java:2109:in `send'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:34:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:306:in `with_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:30:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/template.rb:205:in `render_template'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:265:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:348:in `_render_with_layout'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:262:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1252:in `render_for_file'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:936:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1328:in `default_render'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1334:in `perform_action'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:617:in `call_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
gems/gems/actionpack-2.3.15/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
org/jruby/RubyKernel.java:2105:in `send'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:532:in `process'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:606:in `process_with_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:391:in `process'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:386:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/routing/route_set.rb:438:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:87:in `dispatch'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:121:in `_call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
org/jruby/RubyProc.java:270:in `call'
org/jruby/RubyProc.java:220:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:29:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:9:in `cache'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:28:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/string_coercion.rb:25:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
file:lib/jruby-rack-1.1.10.jar!/jruby/rack/session_store.rb:70:in `context'
gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
file:lib/jruby-rack-1.1.10.jar!/rack/adapter/rails.rb:34:in `serve_rails'
file:lib/jruby-rack-1.1.10.jar!/rack/adapter/rails.rb:39:in `call'
file:lib/jruby-rack-1.1.10.jar!/rack/handler/servlet.rb:22:in `call'
Anyone have an idea ?
Regards,
Stephane

This feature is buggy. That's why it was removed: http://jira.codehaus.org/browse/SONAR-4887

Related

Error TypeError: can't dup NilClass - Stripe

I am getting an error ERROR TypeError: can't dup NilClass when processing a Strip charge. I have followed the rails stripe integration documentation.
The error from the terminal is:
Started POST "/charges" for ::1 at 2016-05-27 12:35:48 +0100
Processing by ChargesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"URydkbi6DghMZnzVqbf79KU+YRy/T+9g3UQ8tO8HTXG4uqvEMzdm6V/EjseNiZiIPS3ziOJJTpJ1K+gGMipksg==", "stripeToken"=>"tok_18FjA2JxArkI2Z35Q4MB3sCE", "stripeTokenType"=>"card", "stripeEmail"=>"fergusmorton#live.com"}
[2016-05-27 12:35:48] ERROR TypeError: can't dup NilClass
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httprequest.rb:392:in `dup'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httprequest.rb:392:in `meta_vars'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:59:in `service'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
Completed 500 Internal Server Error in 55ms (ActiveRecord: 0.0ms)
Net::HTTPFatalError (500 "Internal Server Error "):
app/controllers/charges_controller.rb:9:in `create'
Net::HTTPFatalError: 500 "Internal Server Error "
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http/response.rb:119:in `error!'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http/response.rb:128:in `value'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:915:in `connect'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:852:in `start'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/request.rb:413:in `transmit'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/request.rb:176:in `execute'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/request.rb:41:in `execute'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/stripe-1.43.0/lib/stripe.rb:298:in `execute_request'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/stripe-1.43.0/lib/stripe.rb:196:in `execute_request_with_rescues'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/stripe-1.43.0/lib/stripe.rb:148:in `request'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/stripe-1.43.0/lib/stripe/api_operations/request.rb:15:in `request'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/stripe-1.43.0/lib/stripe/api_operations/create.rb:5:in `create'
from C:/Users/Fergus/best-ever-me-v-1.1/app/controllers/charges_controller.rb:9:in `create'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/abstract_controller/base.rb:198:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:117:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:117:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/abstract_controller/callbacks.rb:19:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `block in instrument'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `instrument'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/abstract_controller/base.rb:137:in `process'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionview-4.2.5/lib/action_view/rendering.rb:30:in `process'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal.rb:196:in `dispatch'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_controller/metal.rb:237:in `block in action'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:76:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:45:in `serve'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:43:in `block in serve'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:30:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:30:in `serve'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:817:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/flash.rb:260:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/cookies.rb:560:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:36:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:377:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:73:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:28:in `block in call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `catch'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:38:in `call_app'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `block in call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:26:in `tagged'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `tagged'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/static.rb:116:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/engine.rb:518:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
charges_controller.rb
class ChargesController < ApplicationController
def new
end
def create
# Amount in cents
#amount = 500
customer = Stripe::Customer.create(
:email => params[:stripeEmail],
:source => params[:stripeToken]
)
charge = Stripe::Charge.create(
:customer => customer.id,
:amount => #amount,
:description => 'Rails Stripe customer',
:currency => 'usd'
)
rescue Stripe::CardError => e
flash[:error] = e.message
redirect_to new_charge_path
end
end
initiliazers/stripe.rb
Rails.configuration.stripe = {
:publishable_key => ENV['PUBLISHABLE_KEY'],
:secret_key => ENV['SECRET_KEY']
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]
cart/show.html.erb
<div class="shopping-cart" style="margin-top:160px;">
<%= render "shopping_cart" %>
<%= form_tag charges_path do %>
<article>
<% if flash[:error].present? %>
<div id="error_explanation">
<p><%= flash[:error] %></p>
</div>
<% end %>
<label class="amount">
<span>Amount: €<%= current_order.subtotal %> </span>
</label>
</article>
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<%= Rails.configuration.stripe[:publishable_key] %>"
data-description="Cart Total"
data-amount="<%= current_order.subtotal %>"
data-locale="auto"></script>
<% end %>
</div>
Updated log Following Michael's Suggestions.
Started POST "/charges" for ::1 at 2016-05-31 11:45:45 +0100
Processing by ChargesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"qXPL5OhG1UA+Ui4uyB7+80/UGDGXFPnOevOf/kmZhitA1f2xY8u9oS3w3DzsIJ2P18eKpcoSWDzSnEtMlLSv6A==", "stripeToken"=>"tok_18HANXJxArkI2Z35encjc3uW", "stripeTokenType"=>"card", "stripeEmail"=>"fergusmorton#live.com"}
Unpermitted parameters: utf8, authenticity_token, stripeTokenType
Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.0ms)
NoMethodError (undefined method `stripe_customer_id' for nil:NilClass):
app/controllers/charges_controller.rb:15:in `create'
NoMethodError: undefined method `stripe_customer_id' for nil:NilClass
From the code that you've shown, it looks like you may have a couple of issues, but there may be additional issues related to setup for Stripe Payment.
The process for setting up Stripe within your application is covered here.
Setup Stripe in your Application
Add Stripe keys to your config/secrets.yml file:
development:
stripe_private_key: <%= ENV["STRIPE_PRIVATE_KEY"] %>
stripe_public_key: <%= ENV["STRIPE_PUBLIC_KEY"] %>
You can keep the STRIPE_PRIVATE_KEY and STRIPE_PUBLIC_KEY in your environment. Test and production environments would require similar configuration settings.
Make certain to add this code to your controller, or in any code that you intend to use the Stripe API:
require "stripe"
Stripe.api_key = Rails.application.secrets.stripe_private_key
Add a Migration to Add Stripe Customer ID to Customer
This migration provides an example based on a User class; your application may use a different model, so adjust as necessary to fit your purpose.
class AddUserStripeCustomerId < ActiveRecord::Migration
def change
change_table :users do |t|
t.string :stripe_customer_id, limit: 50, null: true
end
end
end
Create a Customer
When you're ready to begin the billing process for a customer, create the customer:
if !#user.stripe_customer_id
customer = Stripe::Customer.create(
:email => stripe_details[:stripeEmail],
:source => stripe_details[:stripeToken]
)
User.update(stripe_customer_id: customer)
end
Make sure to save the customer ID in your User model. You'll need to take care to not re-create and overwrite your customer ID for a user, because this is your tie-in to the Stripe payments system for that user.
Implement the Controller
The form elements (parameters) that you're submitting aren't scoped like a Rails model-based form. Typically, this is due to using a form_tag for a form that's not based directly on a model. This means that instead of having parameters scoped by a model hash, the parameters are unscoped.
Your strong parameters aren't included here, but they may be part of the issue. Make sure that you have the stripeToken and stripeEmail included in the permit list, like so:
params.permit(:stripeToken, :stripeCard, :stripeEmail)
Make certain to not include the typical require method on the strong parameters, as that validates that the parameters are scoped by a model object. In your create method, you should call the strong parameters method, and use the result, like so:
require "stripe"
class ChargesController < ApplicationController
Stripe.api_key = Rails.application.secrets.stripe_private_key
def new
end
def create
# Amount in cents
#amount = 500
stripe_details = stripe_params
if !#user.stripe_customer_id
customer = Stripe::Customer.create(
:email => stripe_details[:stripeEmail],
:source => stripe_details[:stripeToken]
)
User.update(stripe_customer_id: customer)
end
charge = Stripe::Charge.create(
:customer => customer.id,
:amount => #amount,
:description => 'Rails Stripe customer',
:currency => 'usd'
)
rescue Stripe::CardError => e
flash[:error] = e.message
redirect_to new_charge_path
end
private
def stripe_params
params.permit(:stripeToken, :stripeCard, :stripeEmail)
end
end
More Information
Also check out How to create a charge and a customer in Stripe (Rails) for additional details on managing customer accounts and charges with Stripe.

Rails 3.2 activerecord cookies throwing error

Occasionally on my local computer, when importing database dump from my production database, I get this when trying to log in:
ActiveRecord::StatementInvalid - PG::SyntaxError: ERROR: zero-length delimited identifier at or near """"
LINE 5: ..." = '2015-12-21 02:17:25.574627' WHERE "sessions"."" = 40276...
^
: UPDATE "sessions" SET "data" = 'some data I removed=
', "updated_at" = '2015-12-21 02:17:25.574627' WHERE "sessions"."" = 402761:
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:291:in `translate_exception'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/postgresql_adapter.rb:1155:in `translate_exception'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:284:in `rescue in log'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `log'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_delete'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/database_statements.rb:96:in `update'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `update'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:359:in `update'
(gem) activerecord-3.2.22/lib/active_record/locking/optimistic.rb:68:in `update'
(gem) activerecord-3.2.22/lib/active_record/attribute_methods/dirty.rb:74:in `update'
(gem) activerecord-3.2.22/lib/active_record/timestamp.rb:71:in `update'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:272:in `block in update'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:403:in `_run__115690163__update__488215436__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:272:in `update'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:348:in `create_or_update'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:264:in `block in create_or_update'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:425:in `_run__115690163__save__488215436__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:264:in `create_or_update'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:84:in `save'
(gem) activerecord-3.2.22/lib/active_record/validations.rb:50:in `save'
(gem) activerecord-3.2.22/lib/active_record/attribute_methods/dirty.rb:22:in `save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:208:in `transaction'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:259:in `block in save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:258:in `save'
(gem) activerecord-3.2.22/lib/active_record/session_store.rb:323:in `block in set_session'
(gem) activesupport-3.2.22/lib/active_support/benchmarkable.rb:50:in `silence'
(gem) activerecord-3.2.22/lib/active_record/session_store.rb:320:in `set_session'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:327:in `commit_session'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:211:in `context'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:205:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/cookies.rb:341:in `call'
(gem) activerecord-3.2.22/lib/active_record/query_cache.rb:64:in `call'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `_run__649130748__call__488215436__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/reloader.rb:65:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:84:in `protected_app_call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:79:in `better_errors_call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:56:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:32:in `call_app'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:16:in `block in call'
(gem) activesupport-3.2.22/lib/active_support/tagged_logging.rb:22:in `tagged'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:16:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/request_id.rb:22:in `call'
(gem) rack-1.4.7/lib/rack/methodoverride.rb:21:in `call'
(gem) rack-1.4.7/lib/rack/runtime.rb:17:in `call'
(gem) activesupport-3.2.22/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
(gem) rack-1.4.7/lib/rack/lock.rb:15:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/static.rb:83:in `call'
(gem) railties-3.2.22/lib/rails/engine.rb:484:in `call'
(gem) railties-3.2.22/lib/rails/application.rb:231:in `call'
(gem) rack-1.4.7/lib/rack/content_length.rb:14:in `call'
(gem) railties-3.2.22/lib/rails/rack/log_tailer.rb:17:in `call'
(gem) thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
(gem) thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
(gem) thin-1.6.4/lib/thin/connection.rb:53:in `process'
(gem) thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
(gem) eventmachine-1.0.8/lib/eventmachine.rb:193:in `run'
(gem) thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
(gem) thin-1.6.4/lib/thin/server.rb:162:in `start'
(gem) rack-1.4.7/lib/rack/handler/thin.rb:13:in `run'
(gem) rack-1.4.7/lib/rack/server.rb:268:in `start'
(gem) railties-3.2.22/lib/rails/commands/server.rb:70:in `start'
(gem) railties-3.2.22/lib/rails/commands.rb:55:in `block in <top (required)>'
(gem) railties-3.2.22/lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `<main>'
So I clear the database of sessions (rails dbconsole and delete from sessions;)
But then the error becomes
ActiveRecord::StatementInvalid - PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, 4cb13a797731260dad7f93297f64b0a6, BAh7AA==
, 2015-12-21 02:53:30.976481, 2015-12-21 02:53:30.976481).
: INSERT INTO "sessions" ("created_at", "data", "id", "session_id", "updated_at") VALUES ($1, $2, $3, $4, $5):
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:291:in `translate_exception'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/postgresql_adapter.rb:1155:in `translate_exception'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:284:in `rescue in log'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `log'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in `exec_query'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
(gem) activerecord-3.2.22/lib/active_record/relation.rb:66:in `insert'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:367:in `create'
(gem) activerecord-3.2.22/lib/active_record/timestamp.rb:58:in `create'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:268:in `block in create'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:403:in `_run__58360460__create__915097608__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:268:in `create'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:348:in `create_or_update'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:264:in `block in create_or_update'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:425:in `_run__58360460__save__915097608__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) activerecord-3.2.22/lib/active_record/callbacks.rb:264:in `create_or_update'
(gem) activerecord-3.2.22/lib/active_record/persistence.rb:84:in `save'
(gem) activerecord-3.2.22/lib/active_record/validations.rb:50:in `save'
(gem) activerecord-3.2.22/lib/active_record/attribute_methods/dirty.rb:22:in `save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:208:in `transaction'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:259:in `block in save'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
(gem) activerecord-3.2.22/lib/active_record/transactions.rb:258:in `save'
(gem) activerecord-3.2.22/lib/active_record/session_store.rb:323:in `block in set_session'
(gem) activesupport-3.2.22/lib/active_support/benchmarkable.rb:50:in `silence'
(gem) activerecord-3.2.22/lib/active_record/session_store.rb:320:in `set_session'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:327:in `commit_session'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:211:in `context'
(gem) rack-1.4.7/lib/rack/session/abstract/id.rb:205:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/cookies.rb:341:in `call'
(gem) activerecord-3.2.22/lib/active_record/query_cache.rb:64:in `call'
(gem) activerecord-3.2.22/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `_run__42731031__call__915097608__callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:405:in `__run_callback'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
(gem) activesupport-3.2.22/lib/active_support/callbacks.rb:81:in `run_callbacks'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/reloader.rb:65:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:84:in `protected_app_call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:79:in `better_errors_call'
(gem) better_errors-0.8.0/lib/better_errors/middleware.rb:56:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:32:in `call_app'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:16:in `block in call'
(gem) activesupport-3.2.22/lib/active_support/tagged_logging.rb:22:in `tagged'
(gem) railties-3.2.22/lib/rails/rack/logger.rb:16:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/request_id.rb:22:in `call'
(gem) rack-1.4.7/lib/rack/methodoverride.rb:21:in `call'
(gem) rack-1.4.7/lib/rack/runtime.rb:17:in `call'
(gem) activesupport-3.2.22/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
(gem) rack-1.4.7/lib/rack/lock.rb:15:in `call'
(gem) actionpack-3.2.22/lib/action_dispatch/middleware/static.rb:83:in `call'
(gem) railties-3.2.22/lib/rails/engine.rb:484:in `call'
(gem) railties-3.2.22/lib/rails/application.rb:231:in `call'
(gem) rack-1.4.7/lib/rack/content_length.rb:14:in `call'
(gem) railties-3.2.22/lib/rails/rack/log_tailer.rb:17:in `call'
(gem) thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
(gem) thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
(gem) thin-1.6.4/lib/thin/connection.rb:53:in `process'
(gem) thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
(gem) eventmachine-1.0.8/lib/eventmachine.rb:193:in `run'
(gem) thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
(gem) thin-1.6.4/lib/thin/server.rb:162:in `start'
(gem) rack-1.4.7/lib/rack/handler/thin.rb:13:in `run'
(gem) rack-1.4.7/lib/rack/server.rb:268:in `start'
(gem) railties-3.2.22/lib/rails/commands/server.rb:70:in `start'
(gem) railties-3.2.22/lib/rails/commands.rb:55:in `block in <top (required)>'
(gem) railties-3.2.22/lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `<main>'
Not sure what causes it and usually I'm good for another dump import and usually the problem vanish.
My session_store.rb looks like this:
MyApp::Application.config.session_store :active_record_store, key: 'my_session_name', :domain => :all
The migration file to create the cookies session:
class AddSessionsTable < ActiveRecord::Migration
def change
create_table :sessions do |t|
t.string :session_id, :null => false
t.text :data
t.timestamps
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
end
end
Because I can't explain why things don't work AND can't fix it unless I do another import, I'm wary of deleting old sessions in production.

sonar -> new critical link -> error

Sonar Version: 4.5.5
Clicking on new critical leads to the following error message:
In the sonar log the following error is reported:
2015.10.05 14:45:32 ERROR web[o.s.s.ui.JRubyFacade] Fail to render: http://sonar.intern/drilldown/measures/39596?metric=new_critical_violations&period=1
private method `gsub' called for 1:Fixnum
On line #127 of app/views/drilldown/measures.html.erb
124: metric: ''null,
125: rule: null,
126: severity: null,
127: period: null
128: };
129:
130:
gems/gems/actionpack-2.3.15/lib/action_view/helpers/javascript_helper.rb:143:in `escape_javascript'
app/views/drilldown/measures.html.erb:127
org/jruby/RubyKernel.java:2227:in `send'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:34:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:306:in `with_template'
gems/gems/actionpack-2.3.15/lib/action_view/renderable.rb:30:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/template.rb:205:in `render_template'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:265:in `render'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:348:in `_render_with_layout'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:346:in `_render_with_layout'
gems/gems/actionpack-2.3.15/lib/action_view/base.rb:262:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1252:in `render_for_file'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:936:in `render'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1328:in `default_render'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1334:in `perform_action'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:617:in `call_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
gems/gems/actionpack-2.3.15/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
gems/gems/actionpack-2.3.15/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
org/jruby/RubyKernel.java:2223:in `send'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:532:in `process'
gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:606:in `process_with_filters'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:391:in `process'
gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:386:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/routing/route_set.rb:450:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:87:in `dispatch'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:85:in `dispatch'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:121:in `_call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
org/jruby/RubyProc.java:290:in `call'
org/jruby/RubyProc.java:224:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:29:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:9:in `cache'
gems/gems/activerecord-2.3.15/lib/active_record/query_cache.rb:28:in `call'
gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/string_coercion.rb:25:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
file:/opt/sonarqube-4.5.5/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
file:/opt/sonarqube-4.5.5/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
file:/opt/sonarqube-4.5.5/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
file:/opt/sonarqube-4.5.5/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'
How can this be fixed? Is this a bug? i tried to post in the sonar google group but didn't succeed.
according to Simon BRANDHOF from sonar source. This is a regression and will be fixed in 4.5.6 (see https://jira.sonarsource.com/browse/SONAR-6814)

LoadError in Users::OmniauthCallbacksController#facebook - Rails 4

well, I am trying to code a system that uses facebook login. When I click on the facebook link it goes to facebook page for authentication and on the callback show me this error: Unable to autoload constant Users::OmniauthCallbacksController, expected path/app/controllers/users/omniauth_callbacks_controller.rb to define it.
I am using devise gem, omniauth gem, ruby 2 and rails 4.
My user_controller.rb
class User::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
#user = User.find_for_facebook_oauth(request.env['omniauth.auth'], current_user)
if #user.persisted?
sign_in_and_redirect #user, :event => :authentication #this will throw if #user is not activated
set_flash_message(:notice, :success, :kind => 'Facebook') if is_navigational_format?
else
session['devise.facebook_data'] = request.env['omniauth.auth']
redirect_to new_user_registration_url
end
end
end
My user.rb
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable
def self.find_for_facebook_oauth(auth, signed_in_resource = nil)
user = User.where(:provider => auth.provider, :uid => auth.uid).first
if user
return user
else
registered_user = User.where(:email => auth.info.email).first
if registered_user
return registered_user
else
user = User.create(name:auth.extra.raw_info.name,
provider:auth.provider,
uid:auth.uid,
email:auth.info.email,
password:Devise.friendly_token[0,20],
)
end
end
end
end
On routes.rb I have this line:
devise_for :users, :controllers => { :omniauth_callbacks => 'users/omniauth_callbacks' }
The Full Trace is this:
activesupport (4.0.0) lib/active_support/dependencies.rb:463:in `load_missing_constant'
activesupport (4.0.0) lib/active_support/dependencies.rb:183:in `const_missing'
activesupport (4.0.0) lib/active_support/inflector/methods.rb:228:in `const_get'
activesupport (4.0.0) lib/active_support/inflector/methods.rb:228:in `block in constantize'
activesupport (4.0.0) lib/active_support/inflector/methods.rb:224:in `each'
activesupport (4.0.0) lib/active_support/inflector/methods.rb:224:in `inject'
activesupport (4.0.0) lib/active_support/inflector/methods.rb:224:in `constantize'
activesupport (4.0.0) lib/active_support/dependencies.rb:534:in `get'
activesupport (4.0.0) lib/active_support/dependencies.rb:565:in `constantize'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:66:in `controller'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:44:in `call'
actionpack (4.0.0) lib/action_dispatch/routing/mapper.rb:44:in `call'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:401:in `call_app!'
omniauth (1.1.4) lib/omniauth/strategy.rb:363:in `callback_phase'
omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:77:in `callback_phase'
omniauth (1.1.4) lib/omniauth/strategy.rb:226:in `callback_call'
omniauth (1.1.4) lib/omniauth/strategy.rb:182:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__878755641__call__callbacks'
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
C:/Development/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
C:/Development/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
C:/Development/Ruby200/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
So that's my problem I hope someone can help me.
EDIT: rather than what I implied to, my callbacks controller is called omniauth_callbacks_controller.rb.
1. As sevenseacat suggested I changed the reference from users to user on my route file, but the problem still happened.
2. As *uno_ordinary* suggested I added :omniauth_providers => :facebook on my model but after that I received a new error when starting the server:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:3:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x4375db8 #paths=["C:/Users/Diogo de Lima/Documents/Development/Ruby on Rails/Rhodnius/config/routes.rb"], #route_sets=[#<ActionDispatch::Routing::RouteSet:0x449da98>]> (RuntimeError)
from C:131071:in `execute_if_updated'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from C:/Development/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Diogo de Lima/Documents/Development/Ruby on Rails/Rhodnius/config/environment.rb:5:in `<top (required)>'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from C:/Users/Diogo de Lima/Documents/Development/Ruby on Rails/Rhodnius/config.ru:3:in `block in <main>'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from C:/Users/Diogo de Lima/Documents/Development/Ruby on Rails/Rhodnius/config.ru:in `new'
from C:/Users/Diogo de Lima/Documents/Development/Ruby on Rails/Rhodnius/config.ru:in `<main>'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from C:/Development/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If your callbacks controller is in a file called user_controller.rb (as your post implies), this is incorrect.
To follow Rails' naming conventions, it needs to be in app/controllers/users/omniauth_callbacks_controller.rb (as the error tells you).
You also have a problem with namespacing - your route for the callbacks controller refers to users (plural), while your controller namespace is User (singular).
Try to add to User model the following:
:omniauthable, :omniauth_providers => [:facebook]

Mongomapper and Sinatra undefined method `update_attributes' for nil:NilClass

I getting the error "undefined method `update_attributes' for nil:NilClass" when using Sinatra with MongoMapper.
Model:
class Publication
include MongoMapper::Document
key :page, String
key :title, String
key :body, String
end
and code where i getting error:
post '/edit' do
#article = Publication.update({:page => 'main'}, {$set => {:title => params[:title], :body => params[:body]}})
end
i'm tried to make update in mongo console and it was successfully updated:
> db.publications.update({page: 'main'},{$set: {body: '333', title: '111'}})
> db.publications.find({page: 'main'})
{ "_id" : ObjectId("4fa45046530a6978e3000003"), "body" : "333", "page" : "main", "title" : "111" }
Full stack trace:
[2012-05-06 03:04:22] INFO WEBrick 1.3.1
[2012-05-06 03:04:22] INFO ruby 1.8.7 (2010-01-10) [universal-darwin11.0]
== Sinatra/1.3.2 has taken the stage on 4567 for development with backup from WEBrick
[2012-05-06 03:04:23] INFO WEBrick::HTTPServer#start: pid=32266 port=4567
localhost - - [06/May/2012:03:04:27 MSK] "GET /edit HTTP/1.1" 200 193
- -> /edit
localhost - - [06/May/2012:03:04:27 MSK] "GET /favicon.ico HTTP/1.1" 404 447
- -> /favicon.ico
NoMethodError - undefined method `update_attributes' for nil:NilClass:
/Library/Ruby/Gems/1.8/gems/mongo_mapper- 0.11.1/lib/mongo_mapper/plugins/querying.rb:118:in `update_single'
/Library/Ruby/Gems/1.8/gems/mongo_mapper-0.11.1/lib/mongo_mapper/plugins/querying.rb:117:in `tap'
/Library/Ruby/Gems/1.8/gems/mongo_mapper-0.11.1/lib/mongo_mapper/plugins/querying.rb:117:in `update_single'
/Library/Ruby/Gems/1.8/gems/mongo_mapper-0.11.1/lib/mongo_mapper/plugins/querying.rb:45:in `update'
main.rb:48:in `POST /edit'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `call'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `compile!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `[]'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:822:in `process_route'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `catch'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `process_route'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:784:in `route!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `each'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `route!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:886:in `dispatch!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `catch'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:705:in `call'
/Library/Ruby/Gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
/Library/Ruby/Gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
/Library/Ruby/Gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
/Library/Ruby/Gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
/Library/Ruby/Gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/logger.rb:15:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/showexceptions.rb:21:in `call'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1416:in `synchronize'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1295:in `run!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/main.rb:25
main.rb:53
anyone can say for what reason I do not get properly updated in the ruby code?
You probably meant to have :$set instead of $set as your key:
#article = Publication.update({:page => 'main'}, {:$set => {:title => params[:title], :body => params[:body]}})
What you have is using the global variable $set for the key, which is nil (since all global variables default to nil). For example:
{ $set => "something" } #=> {nil=>"something"}
{ :$set => "something" } #=> {:$set=>"something"}

Resources