Installed gem but getting cannot load such file - ruby-on-rails

I have done the following
gem install crack
And added
gem 'crack'
To my gemfile.
I am then requiring require 'crack'
The error I get when I try and load the route is
cannot load such file -- crack
I have run gem environment and get the following
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin12.0]
- INSTALLATION DIRECTORY: /Users/joshuahornby/.rvm/gems/ruby-2.1.0
- RUBY EXECUTABLE: /Users/joshuahornby/.rvm/rubies/ruby-2.1.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/joshuahornby/.rvm/gems/ruby-2.1.0/bin
- SPEC CACHE DIRECTORY: /Users/joshuahornby/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0/bin
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0#global/bin
- /Users/joshuahornby/.rvm/rubies/ruby-2.1.0/bin
- /Users/joshuahornby/.rvm/bin
- /Applications/MAMP/bin/php/php5.5.3/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
Error trace
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `require'
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `block in require'
activesupport (4.0.3) lib/active_support/dependencies.rb:212:in `block in load_dependency'
activesupport (4.0.3) lib/active_support/dependencies.rb:616:in `new_constants_in'
activesupport (4.0.3) lib/active_support/dependencies.rb:212:in `load_dependency'
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `require'
app/controllers/currencies_controller.rb:3:in `<class:CurrenciesController>'
app/controllers/currencies_controller.rb:1:in `<top (required)>'
activesupport (4.0.3) lib/active_support/dependencies.rb:424:in `load'
activesupport (4.0.3) lib/active_support/dependencies.rb:424:in `block in load_file'
activesupport (4.0.3) lib/active_support/dependencies.rb:616:in `new_constants_in'
activesupport (4.0.3) lib/active_support/dependencies.rb:423:in `load_file'
activesupport (4.0.3) lib/active_support/dependencies.rb:324:in `require_or_load'
activesupport (4.0.3) lib/active_support/dependencies.rb:463:in `load_missing_constant'
activesupport (4.0.3) lib/active_support/dependencies.rb:184:in `const_missing'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:226:in `const_get'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:226:in `block in constantize'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `each'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `inject'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `constantize'
activesupport (4.0.3) lib/active_support/dependencies.rb:535:in `get'
activesupport (4.0.3) lib/active_support/dependencies.rb:566:in `constantize'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:66:in `controller'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:44:in `call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
activerecord (4.0.3) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.3) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.3) lib/active_support/callbacks.rb:373:in `_run__3271670212178920711__call__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.3) lib/rails/engine.rb:511:in `call'
railties (4.0.3) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
This error occurred while loading the following files:
crack
I am guessing it something to do with my ruby version?

Your Gem Path is referring to Ruby 2.1.0
- GEM PATHS:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0
whereas crack gem is installed for Ruby 2.0.0-p353
/Users/joshuahornby/.rvm/gems/ruby-2.0.0-p353/gems/crack-0.4.2
This is the problem. I simulated the same installation like yours and my GEM_PATH matches to the crack gem path.
Here is what I recommend. First uninstall the gem crack.
In your application path run rvm use 2.1.0 and then do bundle install.

Related

How to include purecss to my application when using rails-assets

So I use this gem: gem 'rails-assets-purecss', '~> 0.6.0' to fetch the purecss library.
Now how can I include it into my project? *= require purecss and *= require_tree purecss both throw errors.
I understand that this library has many folders inside of it with each containing seperate files. But should the require_tree not be the tool for this kind of job then?
Errors:
Sprockets::FileNotFound - couldn't find file 'purecss' with type 'text/css':
app/assets/stylesheets/application.css.scss:3:in `'
sprockets (3.1.0) lib/sprockets/resolve.rb:64:in `resolve!'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:399:in `resolve'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:207:in `process_require_directive'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:180:in `block in process_directives'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:178:in `each'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:178:in `process_directives'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:83:in `_call'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:68:in `call'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.1.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri'
sprockets (3.1.0) lib/sprockets/loader.rb:45:in `block in load'
sprockets (3.1.0) lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
sprockets (3.1.0) lib/sprockets/loader.rb:38:in `load'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `yield'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.1.0) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.1.0) lib/sprockets/utils.rb:183:in `dfs'
sprockets (3.1.0) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.1.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri'
sprockets (3.1.0) lib/sprockets/loader.rb:45:in `block in load'
sprockets (3.1.0) lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
sprockets (3.1.0) lib/sprockets/loader.rb:38:in `load'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `yield'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.1.0) lib/sprockets/base.rb:63:in `find_asset'
sprockets (3.1.0) lib/sprockets/environment.rb:30:in `find_asset'
sprockets (3.1.0) lib/sprockets/base.rb:89:in `[]'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:243:in `lookup_asset_for_path'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:203:in `check_errors_for'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:172:in `block in stylesheet_link_tag'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:171:in `map'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:171:in `stylesheet_link_tag'
app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb___2778102101062006255_69903052436420'
actionview (4.2.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.0) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:143:in `render'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.2.0) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.0) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.0) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/kaspar/.rbenv/versions/2.2.0/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
app/controllers/application_controller.rb:35:in `intercept_html_requests'
activesupport (4.2.0) lib/active_support/callbacks.rb:427:in `block in make_lambda'
activesupport (4.2.0) lib/active_support/callbacks.rb:163:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:163:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.0) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal.rb:236:in `block in action'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.6.1) lib/rack/etag.rb:24:in `call'
rack (1.6.1) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.1) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
activerecord (4.2.0) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) 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.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.1) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
passenger (5.0.7) lib/phusion_passenger/rack/thread_handler_extension.rb:89:in `process_request'
passenger (5.0.7) lib/phusion_passenger/request_handler/thread_handler.rb:155:in `accept_and_process_next_request'
passenger (5.0.7) lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
passenger (5.0.7) lib/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'
passenger (5.0.7) lib/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'
Sprockets::ArgumentError - require_tree argument must be a relative path:
app/assets/stylesheets/application.css.scss:3:in `'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:383:in `expand_relative_dirname'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:244:in `process_require_tree_directive'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:180:in `block in process_directives'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:178:in `each'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:178:in `process_directives'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:83:in `_call'
sprockets (3.1.0) lib/sprockets/directive_processor.rb:68:in `call'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.1.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri'
sprockets (3.1.0) lib/sprockets/loader.rb:45:in `block in load'
sprockets (3.1.0) lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
sprockets (3.1.0) lib/sprockets/loader.rb:38:in `load'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `yield'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.1.0) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.1.0) lib/sprockets/utils.rb:183:in `dfs'
sprockets (3.1.0) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.1.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.1.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri'
sprockets (3.1.0) lib/sprockets/loader.rb:45:in `block in load'
sprockets (3.1.0) lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
sprockets (3.1.0) lib/sprockets/loader.rb:38:in `load'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `yield'
sprockets (3.1.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.1.0) lib/sprockets/base.rb:63:in `find_asset'
sprockets (3.1.0) lib/sprockets/environment.rb:30:in `find_asset'
sprockets (3.1.0) lib/sprockets/base.rb:89:in `[]'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:243:in `lookup_asset_for_path'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:203:in `check_errors_for'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:172:in `block in stylesheet_link_tag'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:171:in `map'
sprockets-rails (2.3.1) lib/sprockets/rails/helper.rb:171:in `stylesheet_link_tag'
app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb___3221601988042554075_70183562561420'
actionview (4.2.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.0) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.0) lib/action_view/template.rb:143:in `render'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.0) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.2.0) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.2.0) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.0) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.0) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.0) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.0) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/kaspar/.rbenv/versions/2.2.0/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
activesupport (4.2.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
app/controllers/application_controller.rb:35:in `intercept_html_requests'
activesupport (4.2.0) lib/active_support/callbacks.rb:427:in `block in make_lambda'
activesupport (4.2.0) lib/active_support/callbacks.rb:163:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:163:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:234:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:169:in `block in halting'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:92:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.0) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.0) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.0) lib/action_controller/metal.rb:236:in `block in action'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:42:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.6.1) lib/rack/etag.rb:24:in `call'
rack (1.6.1) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.1) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
activerecord (4.2.0) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) 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.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.1) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.1) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
passenger (5.0.7) lib/phusion_passenger/rack/thread_handler_extension.rb:89:in `process_request'
passenger (5.0.7) lib/phusion_passenger/request_handler/thread_handler.rb:155:in `accept_and_process_next_request'
passenger (5.0.7) lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
passenger (5.0.7) lib/phusion_passenger/request_handler.rb:414:in `block (3 levels) in start_threads'
passenger (5.0.7) lib/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'
GEMfile:
source 'http://rubygems.org'
# Environment versions. These versions will be used for main development
# Make sure your own environment contains the same versions of Ruby and Ruby on Rails
ruby '2.2.0'
gem 'rails', '4.2.0'
# Gems for assets
gem 'sass-rails', '~> 5.0.3'
gem 'coffee-rails'
gem 'sprockets'
# Database gems
gem 'pg'
gem 'schema_plus'
gem 'redis'
# Rails server
gem 'passenger'
# Common gems
gem 'quiet_assets'
gem 'uglifier', '>= 1.3.0'
gem 'turbolinks'
gem 'jbuilder', '~> 2.2.11'
gem 'sdoc', '~> 0.4.1', group: :doc
gem 'devise'
gem 'paperclip'
gem 'active_model_serializers', '~> 0.10.0.rc2'
#gem 'active_model_serializers', '~> 0.9.3'
#gem 'active_model_serializers', '~> 0.8.3'
#gem 'active_model_serializers', github: 'rails-api/active_model_serializers'
group :development do
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_21]
gem 'rails_layout'
end
group :production do
gem 'rails_12factor'
end
# Included web assets required by the project
source 'https://rails-assets.org' do
gem 'rails-assets-bootstrap', '~> 3.3.5'
gem 'rails-assets-purecss', '~> 0.6.0'
gem 'rails-assets-angular', '~> 1.4.1'
gem 'rails-assets-angular-route', '~> 1.4.1'
gem 'rails-assets-angular-resource', '~> 1.4.1'
end

When saving a file to RackSpace CloudFiles using Paperclip/Fog, a timeout occurs, when connecting to odd IP address

I have an app that stores images on RackSpace CloudFiles using Paperclip. It's been working fine, but recently it won't save files. The error that occurs is:
Excon::Errors::SocketError (Connection timed out - connect(2) for 94.236.107.224:443 (Errno::ETIMEDOUT)):
In excon/socket.rb I have added some debugging to see the content of #data at the point the request is made. This is:
{
:chunk_size => 1048576,
:ciphers => "HIGH:!SSLv2:!aNULL:!eNULL:!3DES",
:connect_timeout => 60,
:debug_request => false,
:debug_response => true,
:headers => {"User-Agent" => "fog/1.22.0"},
:idempotent => false,
:instrumentor_name => "excon",
:middlewares => [Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock],
:mock => false,
:nonblock => true,
:omit_default_port => false,
:persistent => false,
:read_timeout => 60,
:retry_limit => 4,
:ssl_verify_peer => true,
:tcp_nodelay => false,
:uri_parser => URI,
:write_timeout => 60,
:host => "lon.auth.api.rackspacecloud.com",
:path => "/v2.0",
:port => 443,
:query => nil,
:scheme => "https",
:user => nil,
:password => nil
}
The host is lon.auth.api.rackspacecloud.com, which resolves to 92.52.64.197 (on the server, as well as locally).
However the error is because the connection to 94.236.107.224 times out. A reverse lookup on that IP shows it is also associated with the auth hostname:
$ host 94.236.107.224
224.107.236.94.in-addr.arpa domain name pointer lon.auth.api.rackspacecloud.com.
I presume this IP is no longer in use for the auth service, but I can't see why it's being connected to at all.
So I need to know:
Why is the bad IP being connected to, when it doesn't show up in the log?
How do I fix this so that the correct server is used?
Here is the full error that occurs:
Completed 500 Internal Server Error in 15437.6ms
Excon::Errors::SocketError (Connection timed out - connect(2) for 94.236.107.224:443 (Errno::ETIMEDOUT)):
excon (0.33.0) lib/excon/socket.rb:220:in `connect_nonblock'
excon (0.33.0) lib/excon/socket.rb:220:in `rescue in block in connect'
excon (0.33.0) lib/excon/socket.rb:189:in `block in connect'
excon (0.33.0) lib/excon/socket.rb:185:in `each'
excon (0.33.0) lib/excon/socket.rb:185:in `connect'
excon (0.33.0) lib/excon/ssl_socket.rb:131:in `connect'
excon (0.33.0) lib/excon/socket.rb:28:in `initialize'
excon (0.33.0) lib/excon/ssl_socket.rb:9:in `initialize'
excon (0.33.0) lib/excon/connection.rb:414:in `new'
excon (0.33.0) lib/excon/connection.rb:414:in `socket'
excon (0.33.0) lib/excon/connection.rb:126:in `request_call'
excon (0.33.0) lib/excon/middlewares/mock.rb:42:in `request_call'
excon (0.33.0) lib/excon/middlewares/instrumentor.rb:22:in `request_call'
excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
excon (0.33.0) lib/excon/connection.rb:269:in `request'
fog-core (1.22.0) lib/fog/core/connection.rb:56:in `request'
fog (1.22.0) lib/fog/rackspace/service.rb:34:in `request_without_retry'
fog (1.22.0) lib/fog/rackspace/requests/identity/create_token.rb:15:in `create_token'
fog (1.22.0) lib/fog/rackspace/identity.rb:41:in `authenticate'
fog (1.22.0) lib/fog/rackspace/identity.rb:79:in `initialize'
fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
fog (1.22.0) lib/fog/rackspace/service.rb:116:in `authenticate_v2'
fog (1.22.0) lib/fog/rackspace/service.rb:30:in `authenticate'
fog (1.22.0) lib/fog/rackspace/storage.rb:88:in `authenticate'
fog (1.22.0) lib/fog/rackspace/storage.rb:419:in `initialize'
fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
fog-core (1.22.0) lib/fog/storage.rb:26:in `new'
paperclip (3.4.2) lib/paperclip/storage/fog.rb:208:in `connection'
paperclip (3.4.2) lib/paperclip/storage/fog.rb:218:in `directory'
paperclip (3.4.2) lib/paperclip/storage/fog.rb:100:in `block in flush_writes'
paperclip (3.4.2) lib/paperclip/storage/fog.rb:96:in `each'
paperclip (3.4.2) lib/paperclip/storage/fog.rb:96:in `flush_writes'
paperclip (3.4.2) lib/paperclip/attachment.rb:221:in `save'
paperclip (3.4.2) lib/paperclip/instance_methods.rb:17:in `block in save_attached_files'
paperclip (3.4.2) lib/paperclip/instance_methods.rb:10:in `block in each_attachment'
paperclip (3.4.2) lib/paperclip/instance_methods.rb:9:in `each'
paperclip (3.4.2) lib/paperclip/instance_methods.rb:9:in `each_attachment'
paperclip (3.4.2) lib/paperclip/instance_methods.rb:16:in `save_attached_files'
activesupport (3.2.17) lib/active_support/callbacks.rb:449:in `_run__806665839013247154__save__3701132647492051879__callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.17) lib/active_record/callbacks.rb:264:in `create_or_update'
activerecord (3.2.17) lib/active_record/persistence.rb:84:in `save'
activerecord (3.2.17) lib/active_record/validations.rb:50:in `save'
activerecord (3.2.17) lib/active_record/attribute_methods/dirty.rb:22:in `save'
activerecord (3.2.17) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
activerecord (3.2.17) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
activerecord (3.2.17) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.17) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.17) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
activerecord (3.2.17) lib/active_record/transactions.rb:259:in `block in save'
activerecord (3.2.17) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
activerecord (3.2.17) lib/active_record/transactions.rb:258:in `save'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:28:in `block in save_resource'
activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_save_callbacks'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:27:in `save_resource'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:22:in `block in create_resource'
activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_create_callbacks'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:21:in `create_resource'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:33:in `create'
activeadmin (0.5.1) lib/active_admin/resource_controller/actions.rb:48:in `create'
actionpack (3.2.17) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.17) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.17) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.17) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.17) lib/active_support/callbacks.rb:458:in `_run__2901337515923689909__process_action__4396305873998292606__callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.17) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.17) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.17) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.17) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.17) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.17) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.17) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.17) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.17) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.17) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:in `call'
rack-google_analytics (1.0.2) lib/rack/google_analytics.rb:5:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.17) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `_run__1208023080139519486__call__3701132647492051879__callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.17) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.17) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.17) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.17) lib/rails/engine.rb:484:in `call'
railties (3.2.17) lib/rails/application.rb:231:in `call'
railties (3.2.17) lib/rails/railtie/configurable.rb:30:in `method_missing'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
I was able to successfully authenticate against lon.auth.api.rackspacecloud.com. My guess is that there might be something wrong with the DNS configuration. Let me track someone down to investigate this issue for you.
Kyle
Thanks to #geemus, #Kyle-Rames, and #AshWilson for clues to the puzzle.
RS support told me to change the auth server to lon.identity.api.rackspacecloud.com which I did but then saw the error:
Unknown region :dfw for service cloudFiles. Please use one of the following regions: :lon
Setting the region with rackspace_region: :lon in paperclip_defaults.rb sorted that, and got things working again.
I'm not certain about the specifics on the Rackspace side of things that would result in this. Within excon the resolution to ip happens within Excon::Socket#connect. Not sure how much you know about the nitty-gritty of these things, but thought I would at least point you in that direction in case it might help: https://github.com/geemus/excon/blob/master/lib/excon/socket.rb#L167
That just stays at the socket level at least at presently (we just look this up once at socket connect, and don't propagate it to the data hash). You shouldn't need to override this though (at least in my experience the default behavior is the right one). I'd probably just recommend filing the issue on github against fog at this point (https://github.com/fog/fog/issues/new) so that I can point Rackspace folks at it.

ruby on rails new project gemfile error

I recently installed and created a new project, I followed rails tutorial (http://guides.rubyonrails.org/getting_started.html) and everything was ok.
Now, when I tried to create a new project and start the server I get this:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-09-09 15:28:55] INFO WEBrick 1.3.1
[2013-09-09 15:28:55] INFO ruby 2.0.0 (2013-06-27) [x64-mingw32]
[2013-09-09 15:28:55] INFO WEBrick::HTTPServer#start: pid=12064 port=3000
Started GET "/" for 127.0.0.1 at 2013-09-09 15:28:56 +0100
Gem::LoadError (Specified 'sqlite3' for database adapter, but the gem is not loa
ded. Add `gem 'sqlite3'` to your Gemfile.):
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:58:in `rescue in resolve_hash_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:55:in `resolve_hash_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:46:in `resolve_string_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:30:in `spec'
activerecord (4.0.0) lib/active_record/connection_handling.rb:39:in `establish
_connection'
activerecord (4.0.0) lib/active_record/railtie.rb:175:in `block (2 levels) in
<class:Railtie>'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:38:in `instance_ev
al'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:38:in `execute_hoo
k'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:45:in `block in ru
n_load_hooks'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:44:in `each'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:44:in `run_load_ho
oks'
activerecord (4.0.0) lib/active_record/base.rb:322:in `<module:ActiveRecord>'
activerecord (4.0.0) lib/active_record/base.rb:22:in `<top (required)>'
activerecord (4.0.0) lib/active_record/query_cache.rb:50:in `restore_query_cac
he_settings'
activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call'
activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection
_pool.rb:626:in `call'
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in
call'
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__342058401_
_call__callbacks'
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `c
all'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca
ll'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tag
ged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `
call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_source.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_trace.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (122.
1ms)
When I open a browser window I get
Gem::LoadError
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile.
What can I do to fix this?
According to the error, you need to add sqlite3 gem to your Gemfile (it's just a plain text file that should be on your Redmine root folder). Edit it and add something like.-
gem 'sqlite3'
You may also find this thread useful.-
Ruby on Rails - "Add 'gem sqlite3'' to your Gemfile"

ArgumentError: A copy of ApplicationController has been removed from the module tree but is still active

I am using ActiveAdmin (with customized gemset for Rails 4) with Rails 4.0.0.rc2. Application also has custom-built authorization code based on railscasts #385 and #386.
When I change something in a ActiveAdmin resource file and try to refresh the browser page, I get this error at the current_permission method:
ArgumentError at /admin/courses
A copy of ApplicationController has been removed from the module tree but is still active!
If I try a refresh again, I get:
Circular dependency detected while autoloading constant Permissions
I think this problem has something to do with autoloading of classes in development mode, after a change in the source file. I have seen similar problem posts, but they are for rails 2.3.x. Also, the solution seems to be specifying unloadable in the controller throwing this error, but I am not sure where to put in this snippet in ActiveAdmin.
This might not have anything to do with ActiveAdmin either. It might be about how Permissions class has been built and its usage within Application Controller. If I add a skip_before_filter :authorize in the ActiveAdmin resource class, this error vanishes.
ApplicationController:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :authenticate_user!
before_filter :authorize
delegate :allow_action?, to: :current_permission
helper_method :allow_action?
delegate :allow_param?, to: :current_permission
helper_method :allow_param?
private
def current_permission
#current_permission ||= Permissions.permission_for(current_user)
end
def current_resource
nil
end
def authorize
if current_permission.allow_action?(params[:controller], params[:action], current_resource)
current_permission.permit_params! params
else
redirect_to root_url, alert: "Not authorized."
end
end
end
Permissions.rb:
module Permissions
def self.permission_for(user)
if user.nil?
GuestPermission.new
elsif user.admin?
AdminPermission.new(user)
else
UserPermission.new(user)
end
end
end
admin/courses.rb:
ActiveAdmin.register Course do
index do
column :name
column :description
column :duration
column :status
column :price
default_actions
end
filter :discipline
filter :level
filter :lessons
filter :name
filter :status
end
Gemfile (relevant lines):
gem 'rails', '4.0.0.rc2'
# Use puma as the app server
gem 'puma'
# Administration - Temporary github refs until rails 4 compatible releases
gem 'responders', github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack', github: 'ernie/ransack', branch: 'rails-4'
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'formtastic', github: 'justinfrench/formtastic'
ArgumentError:
ArgumentError - A copy of ApplicationController has been removed from the module tree but is still active!:
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:445:in `load_missing_constant'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:183:in `const_missing'
rspec-core (2.13.1) lib/rspec/core/backward_compatibility.rb:24:in `const_missing'
app/controllers/application_controller.rb:17:in `current_permission'
app/controllers/application_controller.rb:25:in `authorize'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:417:in `_run__1040990970961152968__process_action__callbacks'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0.rc2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.0.rc2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.0.rc2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.0.rc2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.0.rc2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.0.rc2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.0.rc2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.0.rc2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.0.rc2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.0.rc2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.0.rc2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.0.rc2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.0.rc2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.0.rc2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.0.rc2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.0.rc2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.0.rc2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/routing/route_set.rb:655:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.6.4.122) lib/new_relic/rack/error_collector.rb:12:in `call'
newrelic_rpm (3.6.4.122) lib/new_relic/rack/agent_hooks.rb:22:in `call'
newrelic_rpm (3.6.4.122) lib/new_relic/rack/browser_monitoring.rb:16:in `call'
newrelic_rpm (3.6.4.122) lib/new_relic/rack/developer_mode.rb:28:in `call'
meta_request (0.2.7) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.7) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.7) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.0.rc2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.0.rc2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.0.rc2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:373:in `_run__2183739952227501342__call__callbacks'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (0.9.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:56:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0.rc2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0.rc2) lib/rails/engine.rb:511:in `call'
railties (4.0.0.rc2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.1.1) lib/puma/server.rb:369:in `handle_request'
puma (2.1.1) lib/puma/server.rb:246:in `process_client'
puma (2.1.1) lib/puma/server.rb:145:in `block in run'
puma (2.1.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
RuntimeError: Circular Dependency:
RuntimeError - Circular dependency detected while autoloading constant Permissions:
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:460:in `load_missing_constant'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:183:in `const_missing'
rspec-core (2.13.1) lib/rspec/core/backward_compatibility.rb:24:in `const_missing'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:686:in `remove_constant'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:516:in `block in remove_unloadable_constants!'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:516:in `remove_unloadable_constants!'
activesupport (4.0.0.rc2) lib/active_support/dependencies.rb:300:in `clear'
railties (4.0.0.rc2) lib/rails/application/finisher.rb:90:in `block (2 levels) in <module:Finisher>'
activesupport (4.0.0.rc2) lib/active_support/file_update_checker.rb:75:in `execute'
railties (4.0.0.rc2) lib/rails/application/finisher.rb:105:in `block (2 levels) in <module:Finisher>'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:377:in `_run__2753119820186226816__prepare__callbacks'
activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/reloader.rb:62:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (0.9.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:56:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0.rc2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0.rc2) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0.rc2) lib/rails/engine.rb:511:in `call'
railties (4.0.0.rc2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
puma (2.1.1) lib/puma/server.rb:369:in `handle_request'
puma (2.1.1) lib/puma/server.rb:246:in `process_client'
puma (2.1.1) lib/puma/server.rb:145:in `block in run'
puma (2.1.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
Any clue will help.
Let me know if you need to view other code snippets in the application.
For future visitors, I thought I'd provide some clarification on the original problem even though the question is pretty old and there is already an accepted answer.
The ArgumentError: A copy of X has been removed from the module tree but is still active is raised when you are trying to access an automatically reloaded class (in app directory) from one that is not automatically reloaded (in lib directory).
I'm not sure exactly why this is happening, but I found a workaound. Change this:
def current_permission
#current_permission ||= Permissions.permission_for(current_user)
end
To this:
def current_permission
#current_permission ||= ::Permissions.permission_for(current_user)
end
The error is raised at this point in ActiveSupport:
# Load the constant named +const_name+ which is missing from +from_mod+. If
# it is not possible to load the constant into from_mod, try its parent
# module using +const_missing+.
def load_missing_constant(from_mod, const_name)
log_call from_mod, const_name
unless qualified_const_defined?(from_mod.name) && Inflector.constantize(from_mod.name).equal?(from_mod)
raise ArgumentError, "A copy of #{from_mod} has been removed from the module tree but is still active!"
end
# ...
end
The problem only occurs when you don't fully qualify the constant name, so Rails tries looking it up in the ApplicationController namespace.
In you development.rb temporarily try putting
config.cache_classes = true
It worked for me.
I am not using ActiveAdmin, but I just experienced a circular dependency with ApplicationController.
The problem was a helper module was declared improperly:
app/helpers/home_helper.rb
was declared with:
module StaticHelper
After fixing this, everything was peachy. I did not research why this happened and Rails didn't return a more intelligent error message.
You can try put this line in your config/initializers/active_admin.rb:
In Rails <= 4:
config.skip_before_filter :load_footer_variables
In Rails >= 5
config.skip_before_action :load_footer_variables
Like suggested here.
If you have this problem in console, simply close console instead of reload! command as this happens due to automatically reloaded modules being run inside console without being fully reloaded.

Completed 500 Internal Server Error; RestClient::NotAcceptable (406 Not Acceptable)

I'm pretty new in Rails and on stackoverflow so I'll try to be explicite.
I was asking to change someone project, so I get the sources and try to make it works on
my own work computer (that's on Windows ...) to test it on my local browser (cf : rails s). The project is suppose to be working because it's already in production, so I assume that the problem come from my own work environment.
After installing all the needed gems, run bundle install and launch database serveur (the project is using mongodb), I run rails server. The command actually works but as soon as I try to connect on the application with any browser on the localhost adress (http://localhost:3000/) I get an error and I reaaly don't understand the cause...
This is the log I get :
Started GET "/" for 127.0.0.1 at 2012-12-04 14:51:30 +0100
Processing by HomeController#index as HTML
** [Localeapp] 1354629090-- Handling translation updates
** [Localeapp] 1354629090 - polling
** [Localeapp] API CALL: get https://api.localeapp.com/v1/projects/hhMxHgKAzj9p1dFuS0GnTTnemJ5F9dXLDuCa1KacQSymUcmTFk/translations.yml?updated_at=1354612995
** [Localeapp] ATTEMPT 1
Completed 500 Internal Server Error in 1192ms
RestClient::NotAcceptable (406 Not Acceptable):
rest-client (1.6.7) lib/restclient/abstract_response.rb:48:in `return!'
rest-client (1.6.7) lib/restclient/request.rb:230:in `process_result'
rest-client (1.6.7) lib/restclient/request.rb:178:in `block in transmit'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:745:in `start'
rest-client (1.6.7) lib/restclient/request.rb:172:in `transmit'
rest-client (1.6.7) lib/restclient/request.rb:64:in `execute'
rest-client (1.6.7) lib/restclient/request.rb:33:in `execute'
localeapp (0.5.2) lib/localeapp/api_caller.rb:66:in `make_call'
localeapp (0.5.2) lib/localeapp/api_caller.rb:28:in `call'
localeapp (0.5.2) lib/localeapp/api_call.rb:6:in `api_call'
localeapp (0.5.2) lib/localeapp/poller.rb:43:in `poll!'
localeapp (0.5.2) lib/localeapp/rails/controller.rb:14:in `handle_translation_updates'
activesupport (3.2.3) lib/active_support/callbacks.rb:429:in `_run__744959596__process_action__507377612__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
actionpack (3.2.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.3) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:600:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/builder.rb:48:in `call'
mongoid (2.5.0) lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
mongoid (2.5.0) lib/mongoid.rb:133:in `unit_of_work'
mongoid (2.5.0) lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
sass (3.2.1) lib/sass/plugin/rack.rb:54:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/cookies.rb:338:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `_run__286698992__call__202403334__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
quiet_assets (1.0.1) lib/quiet_assets.rb:20:in `call_with_quiet_assets'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
airbrake (3.1.4) lib/airbrake/rack.rb:41:in `call'
airbrake (3.1.4) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.4.1) lib/rack/deflater.rb:13:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
thin (1.4.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.4.1) lib/thin/connection.rb:78:in `catch'
thin (1.4.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.4.1) lib/thin/connection.rb:53:in `process'
thin (1.4.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine-1.0.0-x86 (mingw32) lib/eventmachine.rb:187:in `run_machine'
eventmachine-1.0.0-x86 (mingw32) lib/eventmachine.rb:187:in `run'
thin (1.4.1) lib/thin/backends/base.rb:63:in `start'
thin (1.4.1) lib/thin/server.rb:159:in `start'
rack (1.4.1) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.1) lib/rack/server.rb:265:in `start'
railties (3.2.3) lib/rails/commands/server.rb:70:in `start'
railties (3.2.3) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.3) lib/rails/commands.rb:50:in `tap'
railties (3.2.3) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (4.0ms)
Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms)
Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (56.0ms)
And this is the controller that's mentionned :
class HomeController < ApplicationController
def index
#presenter = Home::IndexPresenter.new
#article_presenter = Articles::IndexPresenter.new(Article.with_state(:published).last)
end
end
If someone could help me it would be very kind. Ask if I forgot to mention something.
Thanks you.
The root problem is that the URL being requested by rest_client is returning the HTTP 406 code, which you can see by running curl, e.g.
curl --include https://api.localeapp.com/v1/projects/hhMxHgKAzj9p1dFuS0GnTTnemJ5F9dXLDuCa1KacQSymUcmTFk/translations.yml?updated_at=1354612995
(I just noticed that you are on a windows environment -- if you don't have access to curl there are several tools you can install that will allow you to make requests)
Then, within your controller, there doesn't appear to be any check to see if the response from the RestClient call was successful (2xx status) or not. Because RestClient raises an exception, you get a 500 error in your application.
So, if you're not sure why the URL is not working, then you'll need to check the API provided by localeapp.com
But given that the API is an external service, you may also want to add some error handling within your software. There are several things out there known as RestClient, but if it's by archiloque, the documentation provides a good example of "result handling" here.

Resources