Cannot load such file -- bcrypt_ext - ruby-on-rails

I'm currently experiencing the failure of bcrypt's encryptor while using Devise for Rails 5.0.1. I never had this issue before with the earlier Rails 4.2. I can't register new users through Devise. I will post information with regards to my gemfile and server log.
Gemfile.rb
gem 'bcrypt', platforms: :ruby
# Devise
gem 'devise'
gem 'devise_security_extension'
gem 'redis'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
Server log
Started POST "/register" for 127.0.0.1 at 2017-01-12 13:50:05 -0500
Processing by Users::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"bH6n7iWLhPMECDzTVkMyTc9FXtvkGrq5+K4wFs1g8Bxbjq9ShaLJP5gn72SFQlHc01j2ao5JKcv57ClWAzwsmw==", "user"=>{"email"=>"craigcarl#codex.com", "username"=>"codex", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
Completed 500 Internal Server Error in 258ms (ActiveRecord: 0.0ms)
LoadError - cannot load such file -- bcrypt_ext:
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
bcrypt-3.1.11-x86 (mingw32) lib/bcrypt.rb:16:in `rescue in <top (required)>'
bcrypt-3.1.11-x86 (mingw32) lib/bcrypt.rb:12:in `<top (required)>'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
devise (4.2.0) lib/devise/encryptor.rb:1:in `<top (required)>'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
devise (4.2.0) lib/devise/models/database_authenticatable.rb:147:in `password_digest'
devise (4.2.0) lib/devise/models/database_authenticatable.rb:40:in `password='
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:46:in `public_send'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:46:in `_assign_attribute'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:40:in `block in _assign_attributes'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:39:in `each'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:39:in `_assign_attributes'
activerecord (5.0.1) lib/active_record/attribute_assignment.rb:26:in `_assign_attributes'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:33:in `assign_attributes'
activerecord (5.0.1) lib/active_record/core.rb:319:in `initialize'
activerecord (5.0.1) lib/active_record/inheritance.rb:65:in `new'
activerecord (5.0.1) lib/active_record/inheritance.rb:65:in `new'
devise (4.2.0) lib/devise/models/registerable.rb:20:in `new_with_session'
devise (4.2.0) app/controllers/devise/registrations_controller.rb:100:in `build_resource'
devise (4.2.0) app/controllers/devise/registrations_controller.rb:15:in `create'
actionpack (5.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.1) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.1) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.1) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.1) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.1) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.1) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.1) lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
actionpack (5.0.1) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
rack (2.0.1) lib/rack/deflater.rb:35:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:38: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.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.1) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79: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 (5.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.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.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.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.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.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.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'
Started POST "/__better_errors/4e4442c3f810d7b9/variables" for 127.0.0.1 at 2017-01-12 13:50:06 -0500

I had a similar problem today with ruby 2.3.3 and rails 4.2.4.
The problem was that bundle install of devise installed as a dependency another version of bcrypt (bcrypt (3.1.11 x86-mingw32) instead of bcrypt (3.1.11)) which was causing trouble with ruby 2.3 (it should work with all previous versions of ruby)
The solution I used is to install bcrypt outside of the gemfile, run bundle and then remove the second version of bcrypt :
$ gem list bcrypt
bcrypt (3.1.11 x86-mingw32)
$ gem uninstall devise && gem uninstall bcrypt
Successfully uninstalled devise-4.2.0
Successfully uninstalled bcrypt-3.1.11-x86-mingw32
$ gem install bcrypt --platform=Ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.11
Parsing documentation for bcrypt-3.1.11
Installing ri documentation for bcrypt-3.1.11
Done installing documentation for bcrypt after 1 seconds
1 gem installed
$ gem list bcrypt
bcrypt (3.1.11)
$ bundle install
...
Installing bcrypt 3.1.11 (x86-mingw32)
...
Installing devise 4.2.0
Bundle complete! 25 Gemfile dependencies, 75 gems now installed.
$ gem list bcrypt
bcrypt (3.1.11 ruby x86-mingw32)
$ gem uninstall bcrypt
Select gem to uninstall:
1. bcrypt-3.1.11
2. bcrypt-3.1.11-x86-mingw32
3. All versions
> 2
Successfully uninstalled bcrypt-3.1.11-x86-mingw32
$ gem list bcrypt
bcrypt (3.1.11)
Hope that helps if you haven't solved your problem yet.

I also encountered the same problem, then I found some references and it's about version only.
When I changed bcrypt back to
bcrypt 3.1.0-x86-mingw32
from
bcrypt 3.1.11-x86-mingw32(the latest now)
Then make sure again in gemfile
gem 'bcrypt-ruby', '3.1.0', :require => 'bcrypt'
then it works fine.

I also face this same issue for ruby '2.3.3' and rails '5.2.0' but the only solution right now is to run:
gem uninstall bcrypt
gem install bcrypt --platform=ruby
temporary fix.

Maybe it's just the native binary is wrongly built or corrupted. Try below
Open a command console
cd to the gem directory C:\RailsInstaller\Ruby2.2.0\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri
Run ruby extconf.rb. It should create the Makefile
Run make. It will builde the extension libraries.
Run make install
See more at Fix issue "cannot load such file -- bcrypt_ext (LoadError)"

These steps to fix issue in MS Win 10 and 8
Uninstall all bcrypt
gem uninstall bcrypt
Go on lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/ and copy bcrypt_ext.so file. and paste on desktop for now.
Uninstall all bcrypt again
gem uninstall bcrypt
Add in your project's gemfile
gem 'bcrypt', '~> 3.1.7'
Run commands
bundle install
bundle update
Paste copied bcrypt_ext.so in folder lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/ from desktop.
Restart server
rails server
It works on win 7 and 10!!!

Related

Rails 5.1: "unknown firstpos: NilClass" - Issue reloading application

Following an upgrade from Rails 5.0 to 5.1 I'm getting this error anytime the app reloads, either from code changes during rails server or if I call reload! from the console.
🌶 13:53$ rc
Loading development environment (Rails 5.1.1)
2.3.1 :001 > reload!
Reloading...
ArgumentError: unknown firstpos: NilClass
from (irb):1
2.3.1 :002 >
https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/journey/gtg/builder.rb
Application Trace is empty, here's the Framework Trace:
actionpack (5.1.1) lib/action_dispatch/journey/gtg/builder.rb:99:in `firstpos'
actionpack (5.1.1) lib/action_dispatch/journey/gtg/builder.rb:22:in `transition_table'
actionpack (5.1.1) lib/action_dispatch/journey/routes.rb:58:in `simulator'
actionpack (5.1.1) lib/action_dispatch/journey/router.rb:92:in `simulator'
actionpack (5.1.1) lib/action_dispatch/journey/router.rb:28:in `eager_load!'
actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:382:in `eager_load!'
railties (5.1.1) lib/rails/application/routes_reloader.rb:26:in `each'
railties (5.1.1) lib/rails/application/routes_reloader.rb:26:in `execute'
railties (5.1.1) lib/rails/application/finisher.rb:141:in `block (2 levels) in <module:Finisher>'
activesupport (5.1.1) lib/active_support/callbacks.rb:413:in `instance_exec'
activesupport (5.1.1) lib/active_support/callbacks.rb:413:in `block in make_lambda'
activesupport (5.1.1) lib/active_support/callbacks.rb:197:in `block (2 levels) in halting'
activesupport (5.1.1) lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator'
activesupport (5.1.1) lib/active_support/callbacks.rb:600:in `catch'
activesupport (5.1.1) lib/active_support/callbacks.rb:600:in `block in default_terminator'
activesupport (5.1.1) lib/active_support/callbacks.rb:198:in `block in halting'
activesupport (5.1.1) lib/active_support/callbacks.rb:507:in `block in invoke_before'
activesupport (5.1.1) lib/active_support/callbacks.rb:507:in `each'
activesupport (5.1.1) lib/active_support/callbacks.rb:507:in `invoke_before'
activesupport (5.1.1) lib/active_support/callbacks.rb:130:in `run_callbacks'
activesupport (5.1.1) lib/active_support/execution_wrapper.rb:108:in `run!'
activesupport (5.1.1) lib/active_support/reloader.rb:113:in `run!'
activesupport (5.1.1) lib/active_support/execution_wrapper.rb:70:in `block in run!'
activesupport (5.1.1) lib/active_support/execution_wrapper.rb:67:in `tap'
activesupport (5.1.1) lib/active_support/execution_wrapper.rb:67:in `run!'
activesupport (5.1.1) lib/active_support/reloader.rb:59:in `run!'
actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:10:in `call'
actionpack (5.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
actionpack (5.1.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.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.1.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
actionpack (5.1.1) 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.1) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.1) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
railties (5.1.1) lib/rails/engine.rb:522: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'
I just faced exactly the same problem. I sovled it by setting:
config/environments/development.rb
from:
# Do not eager load code on boot.
config.eager_load = true
to:
**# Do not eager load code on boot.
config.eager_load = false
Hope this helps!
Cheers, Nic.
Workaround found! https://github.com/rails/rails/pull/32296
The pull request is not merged, and will probably only be in 5.2+ anyway. Adding a monkey patch with the one-line change fixed the problem entirely for me.
config/initializers/routes.rb
# MONKEY PATCH!!!
# https://github.com/rails/rails/pull/32296
#
# Fixes:
# * Development mode deadlocks
# * ArgumentError: unknown firstpos: NilClass
#
# Allows use of "config.eager_load = true"
module ActionDispatch
module Journey
class Routes
def simulator
#simulator ||= begin
gtg = GTG::Builder.new(ast).transition_table unless ast.blank?
GTG::Simulator.new(gtg)
end
end
end
end
end
Seems it is Spring hanging or something. Just run spring stop and it should go away. Alternatively you can start the rails console without spring like this:
DISABLE_SPRING=true rails c.
I started having this problem after upgrading Rails from 5.1 to 5.2
It got solved by:
spring stop
spring binstub --all
spring start
rails s
You will not get this bug in production environment and in a test environment (if you don't use Spring).
Because this bug "ArgumentError: unknown firstpos: NilClass" you got in "reload" when it tried to reload some your classes.
In production and test environments all things are in cache, so all your things will be cached and bug will not happen
Unfortunately (for now) for the development environment, I also found only this solution
config.eager_load = false

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

Installed gem but getting cannot load such file

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.

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"

find_by_id still triggers ActiveRecord::RecordNotFound

When querying for an non-existing post in my controller via
#post = Post.find_by_id(params[:id])
I get ActiveRecord::RecordNotFound. But when I do the same in the rails console I get nil returned.
I also tried find_by_id! (note the exclamation point) that is supposed to trigger a 404, but it still just gives me ActiveRecord::RecordNotFound.
I found out that a gem could cause this kind of problem (see question: Rails Find_by_id raises exception), so my question is how do I figure out which gem that I use could cause the same problem?
This is my Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.7'
gem 'pg'
gem 'jquery-rails'
gem 'fancybox-rails', :git => 'https://github.com/sverigemeny/fancybox-rails'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
gem 'validates_email_format_of', :git => 'git://github.com/alexdunae/validates_email_format_of.git'
gem 'cancan'
gem 'thin'
gem 'chronic'
gem 'simple_form'
gem 'twitter'
gem 'kaminari'
group :assets do
gem 'sass-rails'
gem 'compass-rails'
gem 'coffee-rails'
gem 'uglifier', '>= 1.0.3'
end
group :development do
gem 'quiet_assets'
gem 'faker'
end
I don't see how I can just disable one by one until I find the Gem that might causes this problem because I will most likely trigger many other errors due to Gem dependencies in the process.
Anyone have any idea of how I should go about this?
Update
Here is the full stacktrace:
ActiveRecord::RecordNotFound in PostsController#edit
Couldn't find Post with id=123202
activerecord (3.2.7) lib/active_record/relation/finder_methods.rb:341:in `find_one'
activerecord (3.2.7) lib/active_record/relation/finder_methods.rb:312:in `find_with_ids'
activerecord (3.2.7) lib/active_record/relation/finder_methods.rb:107:in `find'
activerecord (3.2.7) lib/active_record/querying.rb:5:in `find'
cancan (1.6.8) lib/cancan/model_adapters/abstract_adapter.rb:20:in `find'
cancan (1.6.8) lib/cancan/controller_resource.rb:114:in `find_resource'
cancan (1.6.8) lib/cancan/controller_resource.rb:68:in `load_resource_instance'
cancan (1.6.8) lib/cancan/controller_resource.rb:32:in `load_resource'
cancan (1.6.8) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
cancan (1.6.8) lib/cancan/controller_resource.rb:10:in `block in add_before_filter'
activesupport (3.2.7) lib/active_support/callbacks.rb:418:in `_run__4208450199150212965__process_action__1027836660135587880__callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.7) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.7) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.7) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.7) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.7) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.7) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.7) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.7) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.7) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.7) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.7) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.7) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.7) 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.7) 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/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157: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'
actionpack (3.2.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.3) lib/rack/etag.rb:23:in `call'
rack (1.4.3) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.3) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.3) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.7) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `_run__503554315877740465__call__403817388267166975__callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.7) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.7) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.7) 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.7) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.3) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.3) lib/rack/lock.rb:15:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.7) lib/rails/engine.rb:479:in `call'
railties (3.2.7) lib/rails/application.rb:220:in `call'
rack (1.4.3) lib/rack/content_length.rb:14:in `call'
railties (3.2.7) lib/rails/rack/log_tailer.rb:17:in `call'
thin (1.5.0) lib/thin/connection.rb:81:in `block in pre_process'
thin (1.5.0) lib/thin/connection.rb:79:in `catch'
thin (1.5.0) lib/thin/connection.rb:79:in `pre_process'
thin (1.5.0) lib/thin/connection.rb:54:in `process'
thin (1.5.0) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run'
thin (1.5.0) lib/thin/backends/base.rb:63:in `start'
thin (1.5.0) lib/thin/server.rb:159:in `start'
rack (1.4.3) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.3) lib/rack/server.rb:268:in `start'
railties (3.2.7) lib/rails/commands/server.rb:70:in `start'
railties (3.2.7) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.7) lib/rails/commands.rb:50:in `tap'
railties (3.2.7) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
As drewinglis pointed out, this is caused by cancan.
Cancan loads the post to determine whether the user has authorisation to perform whatever action on it. If the post is not found, it will respond with a 404, ActiveRecord::RecordNotFound.
Here, Ryan goes into the reasoning behind this a little: https://github.com/ryanb/cancan/issues/43 he also suggests rescuing from the 404 if that's not the behaviour you require.
drwesinglis and cheeseweasel are correct, this was caused by CanCan. I was not able to get the solutions from the post https://github.com/ryanb/cancan/issues/43 to work, so I removed load_and_authorize_resource from my controllers and I am now checking manually if the user is authorized to complete the action.
My controller now looks like this:
#post = Post.find_by_id(params[:id])
if #post
if can? :update, #post
...
else
flash[:error] = 'You are not authorized to access this post.'
redirect_to root_url
end
else
flash[:error] = 'This post doesn\'t exist.'
redirect_to root_url
end
I will update my code later in the development cycle to redirect to a nicer 404 page, but for now I just show the messages.

Resources