Pageflow installation: Getting 'uninitialized constant Pageflow::User (NameError)' - ruby-on-rails

I'm trying to install Pageflow (latest v.0.6.0) and getting this error, after typing rails generate install:pageflow:
/Library/Ruby/Gems/2.0.0/gems/pageflow-0.6.0/admins/pageflow/membership.rb:11:in `block (2 levels) in <module:Pageflow>': uninitialized constant Pageflow::User (NameError)
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/dsl.rb:75:in `class_eval'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/dsl.rb:75:in `controller'
from /Library/Ruby/Gems/2.0.0/gems/pageflow-0.6.0/admins/pageflow/membership.rb:9:in `block in <module:Pageflow>'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/dsl.rb:16:in `instance_eval'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/dsl.rb:16:in `run_registration_block'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/namespace.rb:213:in `parse_registration_block'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/namespace.rb:48:in `register'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:117:in `register'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin.rb:72:in `register'
from /Library/Ruby/Gems/2.0.0/gems/pageflow-0.6.0/admins/pageflow/membership.rb:2:in `<module:Pageflow>'
from /Library/Ruby/Gems/2.0.0/gems/pageflow-0.6.0/admins/pageflow/membership.rb:1:in `<top (required)>'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:168:in `block in load!'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:168:in `each'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:168:in `load!'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:186:in `routes'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin.rb:76:in `routes'
from /Users/uron/Desktop/onyva/git/suitcase-web/x/config/routes.rb:2:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in `draw'
from /Users/uron/Desktop/onyva/git/suitcase-web/x/config/routes.rb:1:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:102:in `reload_routes!'
from /Users/uron/.bundler/ruby/2.0.0/active_admin-7d477d1bf249/lib/active_admin/application.rb:241:in `block in attach_reloader'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:387:in `_run__3068857999573267334__prepare__callbacks'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:80:in `run_callbacks'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/reloader.rb:46:in `prepare!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:50:in `block in <module:Finisher>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/uron/Desktop/onyva/git/suitcase-web/x/config/environment.rb:5:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
rails server would give me the same.
My Gemfile looks like this:
gem 'rails', '4.0.2'
gem 'ransack'
gem 'inherited_resources', '1.4.1'
gem 'formtastic', '2.3.0'
gem 'nokogiri', '1.5.5'
gem 'resque-scheduler', '2.5.5'
gem 'pageflow'
gem 'activeadmin', git: 'https://github.com/codevise/active_admin.git', branch: 'rails4'
gem 'cancan'
gem 'friendly_id', '~> 5.1.0'
gem 'paperclip'
gem 'marionette-rails'
gem 'devise'
Thankful for any ideas! Just filling these lines up, because it seems like there is too much code in my post.

Related

Rails 5 active admin installation issue

I am new to rails and trying to add active admin on latest version of ruby 2.3.0 and rails5 . i have added below line in gem file :
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'activeadmin', github: 'activeadmin'
did bundle install and then i run the server and i am getting the below error:
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/bundler/gems/inherited_resources-6fa6e5b9d29c/lib/inherited_resources.rb:30:in `block in <top (required)>': break from proc-closure (LocalJumpError)
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `instance_eval'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:49:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:145:in `<class:API>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:88:in `<module:ActionController>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/jbuilder-2.6.1/lib/jbuilder/railtie.rb:20:in `block (2 levels) in <class:Railtie>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `instance_eval'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:33:in `block in on_load'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:32:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:32:in `on_load'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/jbuilder-2.6.1/lib/jbuilder/railtie.rb:19:in `block in <class:Railtie>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/application.rb:352:in `initialize!'
from C:/Sites/second_project/config/environment.rb:5:in `<top (required)>'
from C:/Sites/second_project/config.ru:3:in `require_relative'
from C:/Sites/second_project/config.ru:3:in `block in <main>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from C:/Sites/second_project/config.ru:in `new'
from C:/Sites/second_project/config.ru:in `<main>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:59:in `app'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:77:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I google these error but it seems code error however i have not written any code in newly created project just trying to install active admin for practise.
Please help me to sort this out.
This is due to a recent bug. Just use the latest version from RubyGems, not GitHub. If you omit inherited_resources from your Gemfile this should be done for you by default.
Here is what I would use in my Gemfile:
gem 'activeadmin', github: 'activeadmin'
gem 'inherited_resources'
Looking at 'inherited_resources' github repository, it looks likes the current version in the repo is broken. As a best practice try to use versions of gem that you can control (the call above is not even really clean for a production app)
You may also fall on some SSL error after so to fix this, just add the following to your Gemfile
gem 'openssl', '>=2.0.3'

`initialize': uninitialized constant ActionCable::Server::Configuration::ApplicationCable

I have upgraded my rails project from 4.x to 5.0.0.beta1 for use the actioncable and I have followed the example of DHH but it is not working. When I start the rails server it shows error:
$ rails s
=> Booting Puma
=> Rails 5.0.0.beta1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/configuration.rb:15:in `initialize': uninitialized constant ActionCable::Server::Configuration::ApplicationCable (NameError)
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `new'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `block in <class:Base>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:72:in `block in mattr_reader'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:55:in `mattr_reader'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/attribute_accessors.rb:208:in `mattr_accessor'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:16:in `<class:Base>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:12:in `<module:Server>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:7:in `<module:ActionCable>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable/server/base.rb:6:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actioncable-5.0.0.beta1/lib/action_cable.rb:43:in `server'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/routes.rb:28:in `block in <top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:380:in `instance_exec'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:380:in `eval_block'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_dispatch/routing/route_set.rb:362:in `draw'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/routes.rb:1:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:30:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/application.rb:350:in `initialize!'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config/environment.rb:5:in `<top (required)>'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:3:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:3:in `block in <main>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `instance_eval'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:55:in `initialize'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:in `new'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/config.ru:in `<main>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `eval'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:49:in `new_from_string'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/builder.rb:40:in `parse_file'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:218:in `app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:56:in `app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:353:in `wrapped_app'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:134:in `log_to_stdout'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/server.rb:74:in `start'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/command.rb:20:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.0.beta1/lib/rails/commands.rb:19:in `<top (required)>'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/rails:8:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/rails:8:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/laport/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/laport/Téléchargements/Nouveau TP/Module_chat (copie)/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
This is my Gemfile :
gem 'bcrypt'
gem 'faker'
gem 'carrierwave'
gem 'mini_magick'
gem 'fog'
# gem 'haml-rails'
gem 'sqlite3'
gem 'active_model_serializers', '~> 0.10.0.rc1'
gem 'sprockets'
gem 'sprockets-rails'
gem 'bourbon'
gem 'neat'
gem 'bitters'
gem 'bunny'
gem 'activesupport', '5.0.0.beta1'
gem 'actionpack'
gem 'arel'
gem 'rack'
gem 'puma', '2.15.3'
gem 'actioncable' , '5.0.0.beta1'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'bootstrap-sass'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'sdoc'
You need to add require 'action_cable/engine' to your config/application.rb.
The error is related to not having the correct ActionCable files in your project. You need app/channels/application_cable/channel.rb that looks like this:
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
and
# app/channels/application_cable/connection.rb
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
Add require "action_cable" in config/application.rb
Source:
https://github.com/rails/rails/issues/23183

Rails server returning error with Gemfile

When I run my rails server on Terminal, I get the following message:
Exiting
/Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `devise' for Install (call 'Install.connection' to establish a connection):Class (NoMethodError)
from /Users/Rushal-Marketing/Desktop/pinter/app/models/install.rb:4:in `<class:Install>'
from /Users/Rushal-Marketing/Desktop/pinter/app/models/install.rb:1:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in `const_get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:261:in `block in constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `inject'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/inflector/methods.rb:259:in `constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:566:in `get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:597:in `constantize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:291:in `get'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:81:in `to'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:76:in `modules'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:93:in `routes'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:160:in `default_used_route'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/mapping.rb:70:in `initialize'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:325:in `new'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise.rb:325:in `add_mapping'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:238:in `block in devise_for'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:237:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/devise-3.5.3/lib/devise/rails/routes.rb:237:in `devise_for'
from /Users/Rushal-Marketing/Desktop/pinter/config/routes.rb:4:in `block in <top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in `instance_exec'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:434:in `eval_block'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:412:in `draw'
from /Users/Rushal-Marketing/Desktop/pinter/config/routes.rb:1:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
from /Users/Rushal-Marketing/Desktop/pinter/config/environment.rb:5:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:3:in `block in <main>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:in `new'
from /Users/Rushal-Marketing/Desktop/pinter/config.ru:in `<main>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:61:in `app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:78:in `start'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/Rushal-Marketing/Desktop/pinter/bin/rails:9:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/bin/rails:9:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/rails.rb:28:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/rails.rb:28:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client/command.rb:7:in `call'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/client.rb:28:in `run'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/bin/spring:51:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/binstub.rb:11:in `load'
from /Users/Rushal-Marketing/.rvm/gems/ruby-2.2.1/gems/spring-1.6.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Rushal-Marketing/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Rushal-Marketing/Desktop/pinter/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Here is my Gemfile:
source 'https://rubygems.org'
ruby '2.2.1'
gem 'rails', '~> 4.2.5'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'devise', '~> 3.5.3'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
gem 'bootstrap-sass'
Any assistance with this would be much appreciated! Thanks!
You need to run the command
rails generate devise:install
You need to do it in your console
bundle install
Then
bundle exec rails generate devise:install
bundle exec rails generate device model_name
in your case model_name might be Install
First you have to bundle your gems:
bundle install
Then you have to install devise:
rails g devise:install
And then you have to restart the rails server:
Ctrl + C
$ rails s

undefined method `has_attached_file' : Paperclip error with ActiveAdmin and cucumber

I have installed ActiveAdmin(1.0.0.pre1), Paperclip(4.2.1) and Cucumber(1.4.2).
I am facing strange issue in my system when I do testing with cucumber.
I have a model with paperclip configuration and has method has_attached_file. However everything is working well, but I do testing with cucumber it raises error regarding active admin resource of that model.
Here is full error stack :
undefined method `has_attached_file' for Document (call 'Document.connection' to establish a connection):Class (NoMethodError)
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/home/anand/rails_workspace_20_1_2015/MyApp/app/models/document.rb:7:in `<class:Document>'
/home/anand/rails_workspace_20_1_2015/MyApp/app/models/document.rb:2:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in `require_or_load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:494:in `load_missing_constant'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in `const_missing'
/home/anand/rails_workspace_20_1_2015/MyApp/app/admin/document.rb:2:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:197:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/error.rb:41:in `capture'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:197:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `block in load!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:189:in `load!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin/application.rb:211:in `routes'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bundler/gems/activeadmin-28e8a8f36640/lib/active_admin.rb:79:in `routes'
/home/anand/rails_workspace_20_1_2015/MyApp/config/routes.rb:2:in `block in <top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:410:in `draw'
/home/anand/rails_workspace_20_1_2015/MyApp/config/routes.rb:1:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `call'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `execute'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:427:in `each_strongly_connected_component_from'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `call'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
/home/anand/.rvm/rubies/ruby-2.2.0-preview1/lib/ruby/2.2.0/tsort.rb:205:in `tsort_each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails/application.rb:15:in `initialize!'
/home/anand/rails_workspace_20_1_2015/MyApp/config/environment.rb:5:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails.rb:7:in `require'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-rails-1.4.2/lib/cucumber/rails.rb:7:in `<top (required)>'
/home/anand/rails_workspace_20_1_2015/MyApp/features/support/env.rb:8:in `require'
/home/anand/rails_workspace_20_1_2015/MyApp/features/support/env.rb:8:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/rb_support/rb_language.rb:95:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:184:in `load_step_definitions'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:42:in `run!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/lib/cucumber/cli/main.rb:47:in `execute!'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/gems/cucumber-1.3.19/bin/cucumber:13:in `<top (required)>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/cucumber:23:in `load'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/cucumber:23:in `<main>'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/ruby_executable_hooks:15:in `eval'
/home/anand/.rvm/gems/ruby-2.2.0-preview1/bin/ruby_executable_hooks:15:in `<main>'
Gemfile :
source 'https://rubygems.org'
gem 'devise'
gem 'mysql2'
gem 'cancancan'
gem 'activeadmin' , github: "activeadmin"
gem 'paperclip'
gem 'paper_trail'
gem 'rails', '4.2.1'
gem 'jquery-rails'
group :development, :test do
gem 'byebug'
gem 'pry-byebug'
gem 'pry-stack_explorer'
gem 'pry-rails'
gem 'pry-doc'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'factory_girl_rails'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails', require: false
gem 'rspec-rails'
end
Model :
class Document < ActiveRecord::Base
belongs_to :user
has_paper_trail
has_attached_file :doc, :default_url => "/images/:style/missing.png"
validates_attachment :doc, content_type: {:content_type => ["application/pdf", /\Aimage\/.*\Z/ ] }
end
ActiveAdmin resource :
ActiveAdmin.register_page "Document" do
end
What is the reason to getting this problem ? I have tried searching all the resource from google and may other way to trace it. And finally I have posted here. Need suggestion. Thank you.
After checking all files and experiments, I finally found the solution. The problem was paperclip.rb file in Rails.root/lib folder. The file contains no content but it creates problem while I was running cucumber. So I deleted that file and all works. Let's hope this helps to other :-)

Error installing devise for rails4

I'm trying to migrate an existing app to ruby 2.0 + rails 4.0 and so far everything is working except that when I try to install devise:
rails generate devise:install
I get the following error:
Exiting
/home/lemur/rails_projects/delicateca/config/initializers/devise.rb:76:in `block in <top (required)>': undefined method `skip_session_storage=' for Devise:Module (NoMethodError)
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/devise-1.5.4/lib/devise.rb:252:in `setup'
from /home/lemur/rails_projects/delicateca/config/initializers/devise.rb:3:in `<top (required)>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `block in load'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/engine.rb:608:in `block (2 levels) in <class:Engine>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/engine.rb:607:in `each'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/engine.rb:607:in `block in <class:Engine>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `run'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:44:in `each'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:186:in `each'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:186:in `each_strongly_connected_component'
from /home/lemur/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/tsort.rb:154:in `tsort_each'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/application.rb:213:in `initialize!'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/lemur/rails_projects/delicateca/config/environment.rb:5:in `<top (required)>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `block in require'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/lemur/rails_projects/delicateca/config.ru:3:in `block in <main>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/lemur/rails_projects/delicateca/config.ru:in `new'
from /home/lemur/rails_projects/delicateca/config.ru:in `<main>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:46:in `app'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:71:in `start'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `tap'
from /home/lemur/.rvm/gems/ruby-2.0.0-preview1/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `<top (required)>'
from script/rails:6:in `require'
I get the same error when I try to run the app just doing bundle install and then rails s.
Any idea?
Thanks!
[UPDATE]
The rails4 branch has now been merged into master. So this should be all you need now:
gem 'devise', github: 'plataformatec/devise'
I've left my old answer below.
================================================
The easiest fix today is to use the following in your gemfile:
gem 'devise', github: 'plataformatec/devise', branch: 'rails4'
More details can be found on the comment of this pull request for Devise.
At the time of Lemurido's response, his was the best solution to your error.
This seems to be a dependency issue, as explained by Aaron Paterson:
http://tenderlovemaking.com/2012/12/18/rails-4-and-your-gemfile.html
The solution (in the comments) is updating your gemfile with:
gem 'devise', github: 'idl3/devise', branch: 'rails4'

Resources