Have a problem when I run rails s. I cannot see anything on my browser.
I am using localhost 3000 and when I look in the browser nothing shows.
C:\Sites\Zoom>rails s
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Run `rails server -h` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 3.10.0 (ruby 2.3.3-p222), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/" for 127.0.0.1 at 2018-09-02 21:33:48 +0300
(1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Processing by StaticPagesController#root as HTML
Rendering static_pages/root.html.erb within layouts/application
Rendered static_pages/root.html.erb within layouts/application (9.0ms)
Started GET "/" for 127.0.0.1 at 2018-09-02 21:33:52 +0300
Processing by StaticPagesController#root as HTML
Rendering static_pages/root.html.erb within layouts/application
Rendered static_pages/root.html.erb within layouts/application (1.0ms)
Completed 500 Internal Server Error in 14958ms (ActiveRecord: 0.0ms)
RuntimeError - can't add a new key into hash during iteration:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/set.rb:153:in `replace'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/set.rb:360:in `collect!'
sprockets (3.7.1) lib/sprockets/loader.rb:85:in `asset_from_cache'
sprockets (3.7.1) lib/sprockets/loader.rb:57:in `block in load'
sprockets (3.7.1) lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
sprockets (3.7.1) lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
sprockets (3.7.1) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.1) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.7.1) lib/sprockets/utils.rb:200:in `dfs'
sprockets (3.7.1) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.1) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.1) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.1) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.1) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.1) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.1) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.1) lib/sprockets/base.rb:92:in `[]'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:355:in `find_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:347:in `find_debug_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:229:in `block in lookup_debug_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:242:in `block in resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:228:in `lookup_debug_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:141:in `block in javascript_include_tag'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:140:in `javascript_include_tag'
app/views/layouts/application.html.erb:26:in `_app_views_layouts_application_html_erb___677905375_75171192'
actionview (5.1.4) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.4) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.4) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.4) lib/action_view/template.rb:155:in `render'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:64:in `render_with_layout'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
actionview (5.1.4) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.1.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.1.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.1.4) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.1.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.1.4) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.1.4) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (5.1.4) lib/abstract_controller/rendering.rb:24:in `render'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
activesupport (5.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.1.4) lib/active_record/railties/controller_runtime.rb:29:in `cleanup_view_runtime'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (5.1.4) lib/action_controller/metal/implicit_render.rb:33:in `default_render'
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.4) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.4) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.4) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.4) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `call'
rack (2.0.3) lib/rack/etag.rb:25:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.4) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
better_errors (2.3.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.3.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.3.0) lib/better_errors/middleware.rb:57:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
rack-livereload (0.3.16) lib/rack/livereload.rb:23:in `_call'
rack-livereload (0.3.16) lib/rack/livereload.rb:14:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
railties (5.1.4) lib/rails/engine.rb:522:in `call'
puma (3.10.0) lib/puma/configuration.rb:225:in `call'
puma (3.10.0) lib/puma/server.rb:605:in `handle_request'
puma (3.10.0) lib/puma/server.rb:437:in `process_client'
puma (3.10.0) lib/puma/server.rb:3enter code here01:in `block in run'
puma (3.10.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Completed 200 OK in 11953ms (Views: 11941.5ms | ActiveRecord: 0.0ms)
How can I fix this?
Related
I've been following the Sorcery tutorial to build simple password authentication for a new (blank) Rails app. I've followed it very closely except for translating the erb to haml as I go along.
Everything has worked fine except that when testing the logout function it throws an error that seems to stump Google (see title).
The application trace shows only
app/controllers/user_sessions_controller.rb:16:in `destroy'
highlighting the logout line in user_sessions_controller.rb:
def destroy
logout
redirect_to(:users, notice: 'Logged out!')
end
I'll dump the framework trace below (it means very little to me) and am very happy to provide further information if you let me know what would be helpful. Generic advice on how to debug this kind of error would also be welcome.
activemodel (5.1.6) lib/active_model/attribute_methods.rb:432:in `method_missing'
sorcery (0.12.0) lib/sorcery/adapters/active_record_adapter.rb:6:in `block in update_attributes'
sorcery (0.12.0) lib/sorcery/adapters/active_record_adapter.rb:5:in `each'
sorcery (0.12.0) lib/sorcery/adapters/active_record_adapter.rb:5:in `update_attributes'
sorcery (0.12.0) lib/sorcery/model/submodules/remember_me.rb:67:in `force_forget_me!'
sorcery (0.12.0) lib/sorcery/model/submodules/remember_me.rb:61:in `forget_me!'
sorcery (0.12.0) lib/sorcery/controller/submodules/remember_me.rb:34:in `forget_me!'
sorcery (0.12.0) lib/sorcery/controller.rb:149:in `block in before_logout!'
sorcery (0.12.0) lib/sorcery/controller.rb:149:in `each'
sorcery (0.12.0) lib/sorcery/controller.rb:149:in `before_logout!'
sorcery (0.12.0) lib/sorcery/controller.rb:69:in `logout'
actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.6) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.6) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.6) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'
rack (2.0.5) lib/rack/etag.rb:25:in `call'
rack (2.0.5) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.5) lib/rack/head.rb:12:in `call'
rack (2.0.5) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.5) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.6) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.6.2) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.6.2) lib/web_console/middleware.rb:22:in `block in call'
web-console (3.6.2) lib/web_console/middleware.rb:20:in `catch'
web-console (3.6.2) lib/web_console/middleware.rb:20:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.5) lib/rack/method_override.rb:22:in `call'
rack (2.0.5) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
railties (5.1.6) lib/rails/engine.rb:522:in `call'
puma (3.11.4) lib/puma/configuration.rb:225:in `call'
puma (3.11.4) lib/puma/server.rb:632:in `handle_request'
puma (3.11.4) lib/puma/server.rb:446:in `process_client'
puma (3.11.4) lib/puma/server.rb:306:in `block in run'
puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Restarting the Rails server resolved the problem.
I am working with Ruby 2.3.3, Rails 5.1.5 and using the RubyMine (JetBrains) IDE and I am working the gon gem to send data to javascript. In my application.html.erb I am setting the <%= include_gon %> in the head (as specified by the gon documentation) and I am getting the illegal/malformed utf-8 exception. I ran this same code on C9 with Ruby 2.4.1 and Rails 5.1.4 with no error.
Here is the full stack trace:
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:36:in `to_json'
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:36:in `to_json'
activesupport (5.1.6) lib/active_support/json/encoding.rb:55:in `to_json'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/json/common.rb:224:in `generate'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/json/common.rb:224:in `generate'
activesupport (5.1.6) lib/active_support/json/encoding.rb:100:in `stringify'
activesupport (5.1.6) lib/active_support/json/encoding.rb:33:in `encode'
activesupport (5.1.6) lib/active_support/json/encoding.rb:20:in `encode'
activesupport (5.1.6) lib/active_support/core_ext/object/json.rb:39:in `to_json'
multi_json (1.13.1) lib/multi_json/adapters/json_common.rb:19:in `dump'
multi_json (1.13.1) lib/multi_json/adapter.rb:25:in `dump'
multi_json (1.13.1) lib/multi_json.rb:139:in `dump'
gon (6.2.0) lib/gon/json_dumper.rb:4:in `dump'
gon (6.2.0) lib/gon/base.rb:93:in `to_json'
gon (6.2.0) lib/gon/base.rb:77:in `render_variable'
gon (6.2.0) lib/gon/base.rb:51:in `block in formatted_data'
gon (6.2.0) lib/gon/base.rb:51:in `each'
gon (6.2.0) lib/gon/base.rb:51:in `map'
gon (6.2.0) lib/gon/base.rb:51:in `formatted_data'
gon (6.2.0) lib/gon/base.rb:24:in `render_data'
gon (6.2.0) lib/gon/helpers.rb:5:in `include_gon'
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__726524811_120260856'
actionview (5.1.6) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.6) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.6) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.6) lib/action_view/template.rb:155:in `render'
actionview (5.1.6) lib/action_view/renderer/template_renderer.rb:64:in `render_with_layout'
actionview (5.1.6) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
actionview (5.1.6) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.1.6) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.1.6) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.1.6) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.1.6) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.1.6) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.1.6) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.1.6) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (5.1.6) lib/abstract_controller/rendering.rb:24:in `render'
actionpack (5.1.6) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.1.6) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
activesupport (5.1.6) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (5.1.6) lib/action_controller/metal/implicit_render.rb:33:in `default_render'
actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `tap'
actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.6) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.6) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.6) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call'
rack (2.0.4) lib/rack/etag.rb:25:in `call'
rack (2.0.4) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.4) lib/rack/head.rb:12:in `call'
rack (2.0.4) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.4) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.6) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.4) lib/rack/method_override.rb:22:in `call'
rack (2.0.4) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.4) lib/rack/sendfile.rb:111:in `call'
railties (5.1.6) lib/rails/engine.rb:522:in `call'
puma (3.11.3) lib/puma/configuration.rb:225:in `call'
puma (3.11.3) lib/puma/server.rb:624:in `handle_request'
puma (3.11.3) lib/puma/server.rb:438:in `process_client'
puma (3.11.3) lib/puma/server.rb:302:in `block in run'
puma (3.11.3) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
I have been searching all over the internet for a solution but this dilemma seems to be localized to me. Also, the GemFile does have the gem 'gon' line and I performed a bundle install and update. I have also tried to run this locally on Ruby 2.4.3 and the same error persists. Please help.
I'm new to ruby on rails and currently working on a web application which uses the 'rspotify' gem to interact with the Spotify API.
I have a controller called 'genre' which I use to direct my search results from the index page. However, it won't let me initialize any variables inside the index function.
This is what my controller looks like
# genre_controller.rb
def index
if params[:search]
#genres = RSpotify::Recommendations.generate(limit: 20, seed_genres: ['country'])
# render :json => #songs
else
redirect_to root_path
end
end
This is what my my index page looks like
<h1>Genre#index</h1>
<p>Find me in app/views/genre/index.html.erb</p>
<h1 class="page-header">Music Matching <%= params[:search] %></h1>
<ul>
<% #music.each do |music| %>
<li><%= music.name %> | <%= link_to "Show", genre_path(music.id) %></li>
<% end %>
</ul>
This is what my routes look like
get 'genre/index'
get 'genre/show', to:'genre#show', as: 'genre'
get 'site/index'
root 'site#index'
I get an error on line 4 of my genre controller, where I call the RSpotify method. Any variable I try to instantiate there returns a NoErrorMethod.
Any help is appreciated, thanks!
Edit:
Here's the exception I get from the console
NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/genre_controller.rb:4:in `index'
Started GET "/genre/index?utf8=%E2%9C%93&search=hello" for 127.0.0.1 at 2018-02-19 16:14:59 -0800
Processing by GenreController#index as HTML
Parameters: {"utf8"=>"✓", "search"=>"hello"}
Completed 500 Internal Server Error in 295ms
Here's the full tracestack from the exception
rspotify (1.27.0) lib/rspotify/recommendations.rb:101:in `initialize'
rspotify (1.27.0) lib/rspotify/recommendations.rb:97:in `new'
rspotify (1.27.0) lib/rspotify/recommendations.rb:97:in `generate'
app/controllers/genre_controller.rb:4:in `index'
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.4) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.4) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.4) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.4) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.4) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.4) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `call'
rack (2.0.4) lib/rack/etag.rb:25:in `call'
rack (2.0.4) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.4) lib/rack/head.rb:12:in `call'
rack (2.0.4) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.4) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.4) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.4) lib/rack/method_override.rb:22:in `call'
rack (2.0.4) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.4) lib/rack/sendfile.rb:111:in `call'
railties (5.1.4) lib/rails/engine.rb:522:in `call'
puma (3.11.2) lib/puma/configuration.rb:225:in `call'
puma (3.11.2) lib/puma/server.rb:624:in `handle_request'
puma (3.11.2) lib/puma/server.rb:438:in `process_client'
puma (3.11.2) lib/puma/server.rb:302:in `block in run'
puma (3.11.2) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
I got a similar error as above when I tried to connect to the Spotify API. The documentation on rspotify missed out the fact that you need to run the authenticate method before you do anything with the API.
i.e.
RSpotify.authenticate("<your_client_id>", "<your_client_secret>")
I'm new to Rails. Today I've started to have issues related to Nokogiri and Digest MD5. When I ran rails s for the app I contribute to, it started to complain, first about Nokogiri not being installed and then about Digest md5.
discourse git:(after-hook-event) ✗ bundle install
/Users/jlijo/.rvm/rubies/ruby-2.4.0-turbo/lib/ruby/2.4.0/digest.rb:16:in `const_missing': library not found for class Digest::MD5 -- digest/md5 (LoadError)
I've fixed the issue with Nokogiri doing a xcode-select --install . The console also stopped to complain about digest md5 but still the app won't work (even tho, rails server starts), it raises an error:
Digest::MD5.hexdigest(`convert --version` << `convert -list font`)
undefined method `<<' for nil:NilClass
This is rather desperating, I've spent the whole afternoon trying to solve this issue. I don't know the root of it. I've reinstalled Ruby 2.4.0 again. I've ran gem install bundler, and bundle install.
LOGS:
D, [2017-08-18T19:28:22.945251 #64797] DEBUG -- : ThemeField Load (1.3ms) SELECT "theme_fields".* FROM "theme_fields" JOIN (
SELECT 2 AS theme_id, 0 AS sort_column
) as X ON X.theme_id = theme_fields.theme_id WHERE "theme_fields"."target_id" IN (1, 0) AND "theme_fields"."name" = 'header' ORDER BY sort_column, target_id [["name", "header"]]
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
I, [2017-08-18T19:28:22.973323 #64797] INFO -- : Rendered common/_discourse_javascript.html.erb (22.8ms)
I, [2017-08-18T19:28:22.975885 #64797] INFO -- : Completed 500 Internal Server Error in 683ms (ActiveRecord: 98.6ms)
F, [2017-08-18T19:28:22.994012 #64797] FATAL -- :
NoMethodError - undefined method `<<' for nil:NilClass:
lib/letter_avatar.rb:103:in `image_magick_version'
lib/letter_avatar.rb:26:in `version'
app/views/common/_discourse_javascript.html.erb:44:in `_app_views_common__discourse_javascript_html_erb___995238869359027967_70217684279780'
actionview (4.2.9) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.9) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.9) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.9) lib/action_view/template.rb:143:in `render'
rack-mini-profiler (0.10.5) lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
actionview (4.2.9) lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
actionview (4.2.9) lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
actionview (4.2.9) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.9) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.9) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.9) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.9) lib/action_view/renderer/partial_renderer.rb:309:in `render'
actionview (4.2.9) lib/action_view/renderer/renderer.rb:51:in `render_partial'
actionview (4.2.9) lib/action_view/renderer/renderer.rb:25:in `render'
actionview (4.2.9) lib/action_view/helpers/rendering_helper.rb:32:in `render'
app/views/layouts/application.html.erb:121:in `_app_views_layouts_application_html_erb___469980189180314768_70217688394860'
actionview (4.2.9) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.9) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.9) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.9) lib/action_view/template.rb:143:in `render'
rack-mini-profiler (0.10.5) lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
actionview (4.2.9) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
actionview (4.2.9) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.9) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.9) lib/action_view/renderer/renderer.rb:46:in `render_template'
actionview (4.2.9) lib/action_view/renderer/renderer.rb:27:in `render'
actionview (4.2.9) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.9) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.9) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.9) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.9) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.9) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.9) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (4.2.9) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/jlijo/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
activesupport (4.2.9) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (4.2.9) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:43:in `render'
lib/topic_list_responder.rb:15:in `block (2 levels) in respond_with_list'
actionpack (4.2.9) lib/action_controller/metal/mime_responds.rb:217:in `respond_to'
lib/topic_list_responder.rb:11:in `respond_with_list'
app/controllers/list_controller.rb:91:in `block (2 levels) in <class:ListController>'
actionpack (4.2.9) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.9) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.9) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.9) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.9) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.9) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.9) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.9) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.9) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.9) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.9) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.9) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.9) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.9) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.9) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.9) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.9) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.9) lib/action_view/rendering.rb:30:in `process'
rack-mini-profiler (0.10.5) lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
actionpack (4.2.9) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.9) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.9) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.9) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.9) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.9) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (4.2.9) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.9) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.9) lib/action_dispatch/routing/route_set.rb:817:in `call'
rack-protection (1.5.3) lib/rack/protection/frame_options.rb:31:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/builder.rb:63:in `call'
rack (1.6.8) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.8) lib/rack/head.rb:13:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.8) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.8) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.9) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.9) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.9) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.9) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
logster (1.2.7) lib/logster/middleware/reporter.rb:31:in `call'
railties (4.2.9) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.9) lib/rails/rack/logger.rb:22:in `call'
config/initializers/100-quiet_logger.rb:17:in `call_with_quiet_assets'
config/initializers/100-silence_logger.rb:29:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.8) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.8) lib/rack/runtime.rb:18:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/static.rb:120:in `call'
actionpack (4.2.9) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.8) lib/rack/sendfile.rb:113:in `call'
lib/middleware/missing_avatars.rb:21:in `call'
lib/middleware/turbo_dev.rb:34:in `call'
rack-mini-profiler (0.10.5) lib/mini_profiler/profiler.rb:282:in `call'
message_bus (2.0.5) lib/message_bus/rack/middleware.rb:63:in `call'
railties (4.2.9) lib/rails/engine.rb:518:in `call'
railties (4.2.9) lib/rails/application.rb:165:in `call'
railties (4.2.9) lib/rails/railtie.rb:194:in `method_missing'
rack (1.6.8) lib/rack/urlmap.rb:66:in `block in call'
rack (1.6.8) lib/rack/urlmap.rb:50:in `call'
rack (1.6.8) lib/rack/content_length.rb:15:in `call'
puma (3.9.1) lib/puma/configuration.rb:224:in `call'
puma (3.9.1) lib/puma/server.rb:602:in `handle_request'
puma (3.9.1) lib/puma/server.rb:435:in `process_client'
puma (3.9.1) lib/puma/server.rb:299:in `block in run'
puma (3.9.1) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
D, [2017-08-18T19:28:23.107322 #64797] DEBUG -- :
D, [2017-08-18T19:28:23.107454 #64797] DEBUG -- :
I, [2017-08-18T19:28:23.107604 #64797] INFO -- : Started POST "/__better_errors/5a9496d634c72ab8/variables" for ::1 at 2017-08-18 19:28:23 +0200
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
bin/rails: No such file or directory - convert
You might not have ImageMagick installed, which is where the convert command comes from. That will error out and leave you with nil.
I am getting this error on a new rails app after creating a controller with rails g controller hello index. Rails is having a problem adding the css file and javascript file. Rails has worked fine before this:
Error
Full Trace:
compile ((execjs):10:18)
eval (eval at <anonymous> ((execjs):24:8), <anonymous>:1:10)
(execjs):24:8
(execjs):30:14
(execjs):1:102
Object.<anonymous> ((execjs):1:120)
Module._compile (module.js:570:32)
Object.Module._extensions..js (module.js:579:10)
Module.load (module.js:487:32)
tryModuleLoad (module.js:446:12)
execjs (2.7.0) lib/execjs/external_runtime.rb:39:in `exec'
execjs (2.7.0) lib/execjs/external_runtime.rb:21:in `eval'
execjs (2.7.0) lib/execjs/external_runtime.rb:46:in `call'
coffee-script (2.4.1) lib/coffee_script.rb:78:in `compile'
sprockets (3.7.0) lib/sprockets/coffee_script_processor.rb:21:in `block in call'
sprockets (3.7.0) lib/sprockets/cache.rb:85:in `fetch'
sprockets (3.7.0) lib/sprockets/coffee_script_processor.rb:20:in `call'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.0) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.0) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.0) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.0) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.0) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.7.0) lib/sprockets/utils.rb:196:in `dfs'
sprockets (3.7.0) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.0) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.0) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.0) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.0) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.0) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.0) lib/sprockets/base.rb:73:in `find_all_linked_assets'
sprockets (3.7.0) lib/sprockets/manifest.rb:142:in `block in find'
sprockets (3.7.0) lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
sprockets (3.7.0) lib/sprockets/path_utils.rb:228:in `block in stat_tree'
sprockets (3.7.0) lib/sprockets/path_utils.rb:212:in `block in stat_directory'
sprockets (3.7.0) lib/sprockets/path_utils.rb:209:in `each'
sprockets (3.7.0) lib/sprockets/path_utils.rb:209:in `stat_directory'
sprockets (3.7.0) lib/sprockets/path_utils.rb:227:in `stat_tree'
sprockets (3.7.0) lib/sprockets/legacy.rb:105:in `each'
sprockets (3.7.0) lib/sprockets/legacy.rb:105:in `block in logical_paths'
sprockets (3.7.0) lib/sprockets/legacy.rb:104:in `each'
sprockets (3.7.0) lib/sprockets/legacy.rb:104:in `logical_paths'
sprockets (3.7.0) lib/sprockets/manifest.rb:140:in `find'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `each'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `map'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `precompiled_assets'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:35:in `asset_precompiled?'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:251:in `block (3 levels) in <class:Railtie>'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:359:in `precompiled?'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:363:in `raise_unless_precompiled_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:348:in `find_debug_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:229:in `block in lookup_debug_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:242:in `block in resolve_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `each'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `detect'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `resolve_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:228:in `lookup_debug_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:170:in `block in stylesheet_link_tag'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:169:in `map'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:169:in `stylesheet_link_tag'
app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3755913814887945423_70333854259400'
actionview (5.0.0.1) lib/action_view/template.rb:158:in `block in render'
activesupport (5.0.0.1) lib/active_support/notifications.rb:166:in `instrument'
actionview (5.0.0.1) lib/action_view/template.rb:348:in `instrument'
actionview (5.0.0.1) lib/action_view/template.rb:156:in `render'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.0.0.1) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.0.0.1) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.0.0.1) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.0.0.1) lib/action_controller/metal/renderers.rb:144:in `render_to_body'
actionpack (5.0.0.1) lib/abstract_controller/rendering.rb:26:in `render'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.0.0.1) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
activesupport (5.0.0.1) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.0.0.1) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (5.0.0.1) lib/action_controller/metal/implicit_render.rb:36:in `default_render'
actionpack (5.0.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
actionpack (5.0.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `tap'
actionpack (5.0.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.0.1) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.0.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.0.1) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.0.1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.0.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.0.1) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.0.1) lib/active_record/migration.rb:552:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
puma (3.6.2) lib/puma/configuration.rb:225:in `call'
puma (3.6.2) lib/puma/server.rb:578:in `handle_request'
puma (3.6.2) lib/puma/server.rb:415:in `process_client'
puma (3.6.2) lib/puma/server.rb:275:in `block in run'
puma (3.6.2) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
same problem, change version of gem coffee-script-source from 1.12.1 to 1.11.1
in Gemfile
gem 'coffee-script-source', '= 1.11.1'
I just had this problem with coffeescript and my quick fix was to add
gem "coffee-script-source", "~> 1.10.0"
to my Gemfile and run bundle update coffee-script-source in the console. Seems to be a problem with that gem.
I solved it in a different way. Remove the comments from
//require jquery
//require jquery_ujs
//require turbolinks
//require_tree.
from the /app/javascripts/application.js file
That solved the problem for me.