I have created a custom environment in rails 2.3(Fedena) by copying the file content under config/environment/production.rb and also added env key in database and other ymls. Db creation and migration was successful on this custom environment. But, I am unable to access site after server launch in custom environment. Starting server doesn't throw any error but while accessing site I receive an error
NoMethodError (undefined method `+' for nil:NilClass)
I am not getting this error on other environments.
The stack trace is below for the error:
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/request.rb:332:in `subdomains'
/home/soarlogic/Documents/rails/fedena/vendor/plugins/subdomain-fu/lib/subdomain-fu.rb:132:in `current_subdomain'
/home/soarlogic/Documents/rails/fedena/vendor/plugins/subdomain-fu/lib/subdomain_fu/routing_extensions.rb:27:in `extract_request_environment'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:441:in `recognize'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/rails/rack/metal.rb:47:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in `run'
/usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.5/lib/commands/server.rb:111
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
Related
I'm having issues with my Vagrant after installing upgrading ruby and rails using Rbenv. Now my vagrant is no longer working. Here is my results from and trying to initialize with vagrant up
Progress: 90%/opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:288:in `initialize': Permission denied #rb_sysopen - /vagrants/public-records/.vagrant/machines/default/virtualbox/id (Errno::EACCES)
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:288:in `open'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:288:in `open'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:288:in `id='
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/import.rb:60:in `import'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/import.rb:13:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/customize.rb:40:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:225:in `action_raw'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:200:in `block in action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:567:in `lock'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:186:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/machine.rb:186:in `action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
I also tried running sudo chmod -R 1777 tmp/ but got the same results.
I also had a lot of problems with vagrant, I think is a good tool but still had many bugs. Every time I had problems with
vagrant up
I just restart my computer.
I wrote an api to upload a image file to server.
when I am upload without a file, it will be error
I tried to rescue it like this:
rescue_from Grape::Exceptions::ValidationErrors do |e|
error! e.message, 404
end
but it doesn't work.
Here is error message:
E, [2015-11-23T22:17:44.337050 #10646] ERROR -- : avatar is invalid (Grape::Exceptions::ValidationErrors)
remote_address: 127.0.0.1
token: Basic bGl4aWJveDpsaXhpYXBpMTIzNA==
method: POST
path: /api/v1/users/change_avatar.json
query: {"avatar"=>"undefined"}
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/endpoint.rb:249:in `block in run'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/endpoint.rb:219:in `run'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/endpoint.rb:201:in `block in call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/macstore1/projects/lixibox/app/controllers/api/v1/api_error_handler.rb:9:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/error.rb:27:in `block in call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/error.rb:26:in `catch'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/error.rb:26:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/builder.rb:153:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/endpoint.rb:202:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/endpoint.rb:190:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/api.rb:114:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/api.rb:44:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/grape-0.13.0/lib/grape/api.rb:39:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/routing/mapper.rb:51:in `serve'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb:30:in `each'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb:30:in `serve'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:819:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/remotipart-1.2.1/lib/remotipart/middleware.rb:27:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activerecord-4.2.1/lib/active_record/query_cache.rb:36:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:88:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/reloader.rb:73:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/airbrake-4.3.0/lib/airbrake/rails/middleware.rb:13:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:84:in `protected_app_call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:79:in `better_errors_call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:57:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/web-console-2.2.1/lib/web_console/middleware.rb:39:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/rack/logger.rb:38:in `call_app'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/rack/logger.rb:20:in `block in call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/rack/logger.rb:20:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/quiet_assets-1.1.0/lib/quiet_assets.rb:27:in `call_with_quiet_assets'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/actionpack-4.2.1/lib/action_dispatch/middleware/static.rb:113:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/airbrake-4.3.0/lib/airbrake/user_informer.rb:16:in `_call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/airbrake-4.3.0/lib/airbrake/user_informer.rb:12:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/engine.rb:518:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/application.rb:164:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run_machine'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/handler/thin.rb:19:in `run'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
/Users/macstore1/projects/lixibox/bin/rails:8:in `require'
/Users/macstore1/projects/lixibox/bin/rails:8:in `<top (required)>'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `load'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/client/command.rb:7:in `call'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/client.rb:26:in `run'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/bin/spring:48:in `<top (required)>'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `load'
/Users/macstore1/.rvm/gems/ruby-2.1.6#lixibox/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/macstore1/projects/lixibox/bin/spring:13:in `require'
/Users/macstore1/projects/lixibox/bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Maybe there is an error in your API somewhere. The following should work (tested with Grape 0.13.0):
module Api
class API < Grape::API
rescue_from Grape::Exceptions::ValidationErrors do |e|
error! e.message, 404
end
resource '/avatars' do
params do
requires :avatar, type: Rack::Multipart::UploadedFile
end
post '/' do
{
filename: params.avatar.filename,
file_type: params.avatar.type
}
end
end
end
end
Also, if you define a rescue_from :all block, be sure to do it as the last block. By the way, Grape has a pretty good documentation.
My Rails app starts but gives me a No Method error. I'm not sure what method is apparently being called on something which doesn't. It can;t be a certain site page as it's happening on every url I try to visit. Anyone able hint where it's failing?
Full stack log:
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:7:in `block in from_exception'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each_with_index'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `each'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `map'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_frame.rb:4:in `from_exception'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/error_page.rb:45:in `backtrace_frames'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:31:in `log_exception'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:23:in `rescue in app_call'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:20:in `app_call'
vendor/ruby/1.9.1/gems/better_errors-0.0.8/lib/better_errors/middleware.rb:14:in `call'
vendor/ruby/1.9.1/gems/bullet-4.1.5/lib/bullet/rack.rb:11:in `call'
vendor/ruby/1.9.1/gems/sass-3.2.0/lib/sass/plugin/rack.rb:54:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
vendor/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call'
vendor/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__2841213657923326046__call__4410644436419050805__callbacks'
vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/reloader.rb:65:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
vendor/ruby/1.9.1/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call'
vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/<user>/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Error given:
NoMethodError in PagesController#home
undefined method `[]' for nil:NilClass
I'm sure you quite beyond this but just to chime in, I had the same error. I commented out the better_errors gem, re-bundled, reran my app, and found I was getting an error elsewhere. I don't know why better_errors was unable to handle it but once I fixed that other error, I re-enabled better_errors and everything was back to normal.
It's odd b/c I haven't had any problems with the gem before. I love it.
I'm following through the 'Crafting Rails' book, and I've come to hurdle I just can't get over in the final Chapter (Chap 7)
When I try to run the project at the end of 7.3, I get:
MultiJson::DecodeError - 756: unexpected token at '"Validation failed: %{errors}"':
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/json-1.6.5/lib/json/common.rb:148:in `parse'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/json-1.6.5/lib/json/common.rb:148:in `parse'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/multi_json-1.1.0/lib/multi_json/engines/json_common.rb:9:in `decode'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/multi_json-1.1.0/lib/multi_json.rb:79:in `decode'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/json/decoding.rb:12:in `decode'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:32:in `locale_value'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:55:in `block in evaluate_source'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:54:in `each'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:54:in `evaluate_source'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `instance_eval'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `evaluate_source'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:636:in `render'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:532:in `haml'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:19:in `exhibit_translations'
/Users/john/Manuals/Rails/Crafting Rails/Chap7/translator-old/lib/translator/app.rb:10:in `block in <class:App>'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `block in compile!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `[]'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `block (3 levels) in route!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `block (2 levels) in route!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:822:in `block in process_route'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `catch'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `process_route'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:784:in `block in route!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `each'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `route!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:886:in `dispatch!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `block in call!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `block in invoke'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `catch'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:705:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `block in call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1416:in `synchronize'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.3/lib/journey/router.rb:68:in `block in call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.3/lib/journey/router.rb:56:in `each'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/journey-1.0.3/lib/journey/router.rb:56:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:594:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/sass-3.1.15/lib/sass/plugin/rack.rb:54:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/head.rb:14:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/flash.rb:242:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/cookies.rb:338:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.2/lib/active_record/query_cache.rb:64:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `_run__2584460681594678013__call__1225515721622234840__callbacks'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:65:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.2/lib/rails/rack/logger.rb:26:in `call_app'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.2/lib/rails/rack/logger.rb:16:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.2/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.2/lib/action_dispatch/middleware/static.rb:61:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.2/lib/rails/engine.rb:479:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.2/lib/rails/application.rb:220:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.2/lib/rails/rack/log_tailer.rb:14:in `call'
/Users/john/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/Users/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/john/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
I've tried stripping all symbols out of that string, but no joy - same issue. Any idea what might be going wrong here? I've literally copied & pasted from the book, so I don't think it's a typo. Could possibly be a redis issue (I'm unfamiliar with it), but it seems to be working fine.
Any ideas appreciated
In gem file declare
gem 'yajl-ruby'
It is used to Parse and encode multiple JSON objects to and from streams or strings continuous.
And require 'yajl/json_gem'
in config/application.rb
After i wrote a simple rails helloworld application and tried to start, the rails version=2.3.5, and disabled AR like:
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
it throwed exception like below,
[FATAL 2011-04-29 17:46:43] merpro_client: /!\ FAILSAFE /!\ Fri Apr 29 17:46:43 +0800 2011
Status: 500 Internal Server Error
uninitialized constant ActionController::Rescue::ClassMethods::Response
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:64:in `call_with_exception'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:90:in `dispatch'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
C:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/Ruby187/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3