Rails 4: devise and omniauthable error - ruby-on-rails

I use devise and omniauth in my Rails 4 app. I did all actions from this page (from answer):
Devise, Omniauth and Facebook integration session error
After adding this :omniauthable into
this string
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
, i'm getting error:
/home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:193:in `normalize_conditions!': You should not use the `match` method in your router without specifying an HTTP method. (RuntimeError)
If you want to expose your action to GET, use `get` in the router:
Instead of: match "controller#action"
Do: get "controller#action"
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1425:in `new'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1425:in `add_route'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1404:in `decomposed_match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `block in match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:1386:in `match'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:365:in `devise_omniauth_callback'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `block (4 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:212:in `block (3 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:376:in `with_devise_exclusive_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:211:in `block (2 levels) in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:311:in `block in devise_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:833:in `block in constraints'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:716:in `scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/mapper.rb:833:in `constraints'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:310:in `devise_scope'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:209:in `block in devise_for'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:192:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/devise-1.5.4/lib/devise/rails/routes.rb:192:in `devise_for'
from /home/u164/nikita/projects/domain-inspect/config/routes.rb:2:in `block in <top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:320:in `instance_exec'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:320:in `eval_block'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/routing/route_set.rb:298:in `draw'
from /home/u164/nikita/projects/domain-inspect/config/routes.rb:1:in `<top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `block in load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:222:in `load'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `call'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:30:in `run'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from /home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/application.rb:213:in `initialize!'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/u164/nikita/projects/domain-inspect/config/environment.rb:5:in `<top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `block in require'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require'
from /home/u164/nikita/projects/domain-inspect/config.ru:3:in `block in <main>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/u164/nikita/projects/domain-inspect/config.ru:in `new'
from /home/u164/nikita/projects/domain-inspect/config.ru:in `<main>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:46:in `app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands/server.rb:71:in `start'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `tap'
from /home/u164/.rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
What should I do? Or there is now way to use devise in rail 4 apps?
UPD 1
Here is my routes.rb
DomainInspect::Application.routes.draw do
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" ,:registrations => "registrations" }
root :to => 'pages#main'
resources :users, only: [:show, :edit, :update]
resources :domains
end

Rails 4 isn't currently supported in the latest release of devise (v2.2.3 as of this writing). However there is currently an active pull request open.
So until this gets merged and released into the wild, you can point your Gemfile to use it with the following:
gem 'devise', :github => 'plataformatec/devise', :branch => 'rails4'

Related

How can I debug a gem in Rails?

I'm attempting to start my rails server, but I'm getting the error trace below.
I've commented out the line mentioned here:
4.2.0/lib/audited/auditor.rb:48:in `audited'
from /home/david-vm/Documents/rails_projects/bane/app/models/user.rb:9:in `<class:User>'
, and I can get it to run, but I'm not sure why that is breaking it. So I was thinking of maybe using byebug to trace down the issue, but can't seem to figure out how I would go about that. Or is there another way I can troubleshoot this issue? Thanks!
Error
/home/david-vm/.rvm/gems/ruby-2.3.0/gems/tiny_tds-0.7.0/lib/tiny_tds/client.rb:74:in `connect': Server name not found in configuration files (TinyTds::Error)
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/tiny_tds-0.7.0/lib/tiny_tds/client.rb:74:in `initialize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/connection_adapters/sqlserver_adapter.rb:280:in `new'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/connection_adapters/sqlserver_adapter.rb:280:in `dblib_connect'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/connection_adapters/sqlserver_adapter.rb:271:in `connect'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/connection_adapters/sqlserver_adapter.rb:59:in `initialize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/sqlserver_base.rb:18:in `new'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-sqlserver-adapter-4.2.3/lib/active_record/sqlserver_base.rb:18:in `sqlserver_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/model_schema.rb:230:in `table_exists?'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/attribute_methods/primary_key.rb:97:in `get_primary_key'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/attribute_methods/primary_key.rb:85:in `reset_primary_key'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.0/lib/active_record/attribute_methods/primary_key.rb:73:in `primary_key'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/audited-activerecord-4.2.0/lib/audited/adapters/active_record.rb:7:in `default_ignored_attributes'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/audited-4.2.0/lib/audited/auditor.rb:48:in `audited'
from /home/david-vm/Documents/rails_projects/bane/app/models/user.rb:9:in `<class:User>'
from /home/david-vm/Documents/rails_projects/bane/app/models/user.rb:1:in `<top (required)>'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `load'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `block in load_file'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:456:in `load_file'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:354:in `require_or_load'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:184:in `const_missing'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:261:in `const_get'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:261:in `block in constantize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `each'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `inject'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in `constantize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:566:in `get'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:597:in `constantize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise.rb:377:in `get'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/mapping.rb:81:in `to'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/mapping.rb:76:in `modules'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/mapping.rb:93:in `routes'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/mapping.rb:160:in `default_used_route'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/mapping.rb:70:in `initialize'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise.rb:411:in `new'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise.rb:411:in `add_mapping'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/rails/routes.rb:241:in `block in devise_for'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/rails/routes.rb:240:in `each'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/devise-4.0.1/lib/devise/rails/routes.rb:240:in `devise_for'
from /home/david-vm/Documents/rails_projects/bane/config/routes.rb:11:in `block in <top (required)>'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `instance_exec'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `eval_block'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:401:in `draw'
from /home/david-vm/Documents/rails_projects/bane/config/routes.rb:1:in `<top (required)>'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/david-vm/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
from /home/david-vm/Documents/rails_projects/bane/config/environment.rb:5:in `<top (required)>'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require_environment!'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environment!'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:67:in `console'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/david-vm/.rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
User.rb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :ldap_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
after_destroy :ensure_an_admin_remains
before_create { generate_token(:auth_token) }
# Audit changes made except for the columns as specified below
audited except: [:last_seen_at, :sign_in_count, :last_sign_in_at, :last_sign_in_ip, :password_digest]
has_associated_audits
acts_as_tagger
acts_as_taggable_on :roles
# associations, methods, etc...
end
Update
Turns out it was a DNS issue, so even though my database.yml hadn't changed- the server name was no longer working. Just added the update in case anyone is having this similar issue, might be worth checking this out.
The answer is IN the stack trace. It's telling you exactly what file ON your system is having the error. The fact that that file came from a gem, or lives in a different part of your computer, is irrelevant.
/home/david-vm/.rvm/gems/ruby-2.3.0/gems/tiny_tds-0.7.0/lib/tiny_tds/client.rb:74:in `connect': Server name not found in configuration files (TinyTds::Error)
Open that file (or whatever file in the backtrace seems most appropriate) with your editor, stick a binding.pry (or byebug, or debugger, whatever you're using) in there before the line it's blowing up on (74). Then restart your app and debug as if it was a file in your app.

routes with devise and devise_token_Auth not working

I am not using the Rails API gem but I am trying to build an api in Rails. I am using the devise gem and the devise_token_auth gem. I just ran the line:
rails g devise_token_auth:install FacilityUser auth
The generate command adbove worked but now my server won't start. The problem is with my routes.rb file.
Rails.application.routes.draw do
devise_for :facility_users, ActiveAdmin::Devise.config
devise_for :users, controllers: {registrations: "users/registrations", sessions: "users/sessions", passwords: "users/passwords"}, skip: [:sessions, :registrations]
root 'landings#index'
mount_devise_token_auth_for 'FacilityUser', at: 'auth'
end
When my route file is as above, I get the following error in my logs when I try to start the server:
davids-MacBook-Pro:waynefacility davidmurray$ rails s
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:430:in `add_route': Invalid route name, already in use: 'new_facility_user_session' (ArgumentError)
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1489:in `add_route'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1466:in `decomposed_match'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1464:in `block in decomposed_match'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1362:in `block (2 levels) in member'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:757:in `scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1362:in `block in member'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1594:in `with_scope_level'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1358:in `member'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1464:in `decomposed_match'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1447:in `block in match'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1437:in `each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1437:in `match'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:630:in `map_method'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:591:in `get'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:377:in `block in devise_session'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1141:in `block in resource'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1605:in `block (2 levels) in resource_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:757:in `scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1605:in `block in resource_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1594:in `with_scope_level'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1604:in `resource_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:1140:in `resource'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:376:in `devise_session'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:266:in `block (4 levels) in devise_for'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:266:in `each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:266:in `block (3 levels) in devise_for'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:470:in `with_devise_exclusive_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:265:in `block (2 levels) in devise_for'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:368:in `block in devise_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:881:in `block in constraints'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:757:in `scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/mapper.rb:881:in `constraints'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:367:in `devise_scope'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:264:in `block in devise_for'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:240:in `each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/bundler/gems/devise-69bee06ceee6/lib/devise/rails/routes.rb:240:in `devise_for'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:25:in `mount_devise_token_auth_for'
from /Users/davidmurray/projects/waynefacility/config/routes.rb:14:in `block in <top (required)>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:315:in `draw'
from /Users/davidmurray/projects/waynefacility/config/routes.rb:1:in `<top (required)>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
from /Users/davidmurray/projects/waynefacility/config/environment.rb:5:in `<top (required)>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /Users/davidmurray/projects/waynefacility/config.ru:3:in `block in <main>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from /Users/davidmurray/projects/waynefacility/config.ru:in `new'
from /Users/davidmurray/projects/waynefacility/config.ru:in `<main>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If I change the order of routes so that mount_devise_token_auth_for 'FacilityUser', at: 'auth' is the first line, then I get the following error:
davids-MacBook-Pro:waynefacility davidmurray$ rails s
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:40:in `block in mount_devise_token_auth_for': uninitialized constant ActionDispatch::Routing::Mapper::Scope (NameError)
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:86:in `unnest_namespace'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:32:in `mount_devise_token_auth_for'
from /Users/davidmurray/projects/waynefacility/config/routes.rb:2:in `block in <top (required)>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:315:in `draw'
from /Users/davidmurray/projects/waynefacility/config/routes.rb:1:in `<top (required)>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `call'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `execute'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/davidmurray/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
from /Users/davidmurray/projects/waynefacility/config/environment.rb:5:in `<top (required)>'
from /Users/davidmurray/projects/waynefacility/config.ru:3:in `block in <main>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from /Users/davidmurray/projects/waynefacility/config.ru:in `new'
from /Users/davidmurray/projects/waynefacility/config.ru:in `<main>'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/davidmurray/.rvm/gems/ruby-2.2.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I tried commenting out a bunch of the routes so all i have is:
mount_devise_token_auth_for 'FacilityUser', at: 'auth'
root 'landings#index'
but then i still get the same block in mount_devise_token_auth_for': uninitialized constant ActionDispatch::Routing::Mapper::Scope (NameError) error.
How do I fix this?
I used like this. It worked for me.
# token auth routes available at /api/v1/auth
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
# devise_for :users
devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations'
}
As you are using devise_token_auth you should mount you route like this:
Rails.application.routes.draw do
# This one conflicts with mount_devise_token_auth,
# if you want to use devise_token_auth you should only use
# mount_devise_token_auth_for.
# devise_for :facility_users, ActiveAdmin::Devise.config
devise_for :users, controllers: { registrations: "users/registrations",
sessions: "users/sessions",
passwords: "users/passwords" },
skip: [:sessions, :registrations]
root 'landings#index'
mount_devise_token_auth_for 'FacilityUser', at: 'auth'
end
It should work.

Error integrating piggybak with rails admin. Undefined method 'nestable'

I try to integrate piggybak in my rails application, using the example initializer for rails_admin from
https://github.com/piggybak/demo/blob/master/config/initializers/rails_admin.rb
When I try to start up the server I get the following error:
/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in block (2 levels) in <top (required)>': undefined methodnestable' for RailsAdmin::Config::Actions:Module (NoMethodError)
This is the server log:
/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in `block (2 levels) in <top (required)>': undefined method `nestable' for RailsAdmin::Config::Actions:Module (NoMethodError)
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `instance_eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `actions'
from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:21:in `block in <top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `call'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `config'
from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:1:in `<top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/dumand/Desktop/Projects/3dgreen/config/environment.rb:5:in `<top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:3:in `block in <main>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `new'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `<main>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
and here is rails_admin initializer:
RailsAdmin.config do |config|
config.main_app_name = ["3D Green"]
### Popular gems integration
## == Devise ==
# config.authenticate_with do
# warden.authenticate! scope: :user
# end
# config.current_user_method(&:current_user)
## == Cancan ==
# config.authorize_with :cancan
## == PaperTrail ==
# config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
config.actions do
dashboard # mandatory
index # mandatory
new
export
bulk_delete
show
edit
delete
show_in_app
nestable do
visible do
[::PiggybakTaxonomy::NavigationNode].include? bindings[:abstract_model].model
end
end
## With an audit adapter, you can add:
# history_index
# history_show
config.model Product do
edit do
include_all_fields
end
end
end
end
Try it with removing nestable taxanomy code because it seems that you didn't uses nested taxanomy as per your models also

Devise generate view

I am following this tutorial:
http://www.rubyonrailstree.blogspot.com/2014/02/ruby-on-rails-device-gem-install-step.html
and I am having trouble with:
rails g devise:views
&
rake db:migrate
both comming up with a simmilar error of:
/home/zach/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.4/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `attr_accessible' for User (call 'User.connection' to establish a connection):Class (NoMethodError)
from /home/zach/HandCoOp/project/HandCo-op/app/models/user.rb:8:in `<class:User>'
from /home/zach/HandCoOp/project/HandCo-op/app/models/user.rb:1:in `<top (required)>'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:443:in `load'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:443:in `block in load_file'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:633:in `new_constants_in'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:442:in `load_file'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:342:in `require_or_load'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:480:in `load_missing_constant'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:180:in `const_missing'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:238:in `const_get'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:238:in `block in constantize'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `each'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `inject'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/inflector/methods.rb:236:in `constantize'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:552:in `get'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:583:in `constantize'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise.rb:259:in `get'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/mapping.rb:103:in `to'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/mapping.rb:98:in `modules'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/mapping.rb:115:in `routes'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/mapping.rb:84:in `initialize'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise.rb:289:in `new'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise.rb:289:in `add_mapping'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/rails/routes.rb:190:in `block in devise_for'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/rails/routes.rb:189:in `each'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/devise-1.4.7/lib/devise/rails/routes.rb:189:in `devise_for'
from /home/zach/HandCoOp/project/HandCo-op/config/routes.rb:2:in `block in <top (required)>'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/routing/route_set.rb:315:in `draw'
from /home/zach/HandCoOp/project/HandCo-op/config/routes.rb:1:in `<top (required)>'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `call'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application/finisher.rb:71:in `block in <module:Finisher>'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/zach/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
from /home/zach/HandCoOp/project/HandCo-op/config/environment.rb:5:in `<top (required)>'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application.rb:276:in `require_environment!'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:51:in `generate'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/zach/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Am I using version of ruby that does not support this yet? I will keep looking into this error and I thank anyone who has information about this issue.
routes.rb:
Rails.application.routes.draw do
devise_for :users
root 'home#index'
user.rb model:
class User < ActiveRecord::Base
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
:email
:password
:password_confirmation
:remember_me
end
thanks, hope this helps!
root 'home#index' should be changed root to: "home#index".
Starting from Rails 4 you do not use attr_accessible. You will have to remove the line.
when using a gem the better solution is to appeal to its docs. So in your case the command to generate views (after you added gem 'devise' to Gemfile and run bundle) should be
a) rails generate devise:install,
b) rails generate devise:views

Rails server suddenly went down

I am working on an app and the rails servr was working fine, but suddenly it has stopped. I tried rebooting my system (iOS) and starting the server again and again and I get this error -
/Users/alokdas/.rvm/gems/ruby-1.9.3-p374#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Users/alokdas/.rvm/gems/ruby-1.9.3-p374#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on htt.://0.0.0.3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/length.rb:14:in `initialize': :in and :within must be a Range (ArgumentError)
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/with.rb:82:in `new'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/with.rb:82:in `block in validates_with'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/with.rb:81:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/with.rb:81:in `validates_with'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activemodel-3.2.11/lib/active_model/validations/length.rb:121:in `validates_length_of'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models/validatable.rb:35:in `block in included'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models/validatable.rb:28:in `class_eval'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models/validatable.rb:28:in `included'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:112:in `include'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:112:in `block (2 levels) in devise'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:92:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:92:in `block in devise'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:123:in `devise_modules_hook!'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/models.rb:90:in `devise'
from /users/alokdas/code/omrails/app/models/view.rb:5:in `<class:View>'
from /users/alokdas/code/omrails/app/models/view.rb:1:in `<top (required)>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:469:in `load'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:469:in `block in load_file'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:468:in `load_file'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:353:in `require_or_load'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:190:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:190:in `const_missing'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:230:in `block in constantize'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:554:in `get'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:588:in `constantize'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise.rb:267:in `get'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/mapping.rb:77:in `to'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/mapping.rb:72:in `modules'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/mapping.rb:89:in `routes'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/mapping.rb:156:in `default_used_route'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/mapping.rb:66:in `initialize'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise.rb:301:in `new'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise.rb:301:in `add_mapping'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/rails/routes.rb:208:in `block in devise_for'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/devise-2.2.3/lib/devise/rails/routes.rb:207:in `devise_for'
from /users/alokdas/code/omrails/config/routes.rb:2:in `block in <top (required)>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /users/alokdas/code/omrails/config/routes.rb:1:in `<top (required)>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /users/alokdas/code/omrails/config/environment.rb:5:in `<top (required)>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /users/alokdas/code/omrails/config.ru:3:in `block in <main>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
from /users/alokdas/code/omrails/config.ru:in `new'
from /users/alokdas/code/omrails/config.ru:in `<main>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /Users/alokdas/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Just before this I had run - rails generate devise:views
Thanks for your help
More Info -
I had used - rails generate devise:install - before and it had created a Sign-up page.
Now I remember that I had used the command 'rails generate devise views' (without the colon in-between) and it had created some files, but not sure where. Could that have created some conflicts?
Here is my view.rb file from Model
class View < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# attr_accessible :title, :body
end
Looks like you did not run rails g devise:install, and i think that if you run and rails g command it will also fail. best option, try installing devise again and if it fails, manually delete all devise related files and try again.

Resources