Rails Apartment gem error generate model - ruby-on-rails

I'm building a multi-tenant application using Apartment gem. But when i am scaffolding or generating any model i am getting the below error :
rails g model Car name
/Users/palmeiras/.rvm/gems/ruby-2.4.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/stack.rb:35:in `build': undefined method `new' for "Apartment::Elevators::Domain":String
Did you mean? next (NoMethodError)
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/stack.rb:99:in `block in build'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/stack.rb:99:in `each'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/stack.rb:99:in `inject'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/actionpack-5.1.1/lib/action_dispatch/middleware/stack.rb:99:in `build'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/engine.rb:508:in `block in app'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/engine.rb:504:in `synchronize'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/engine.rb:504:in `app'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/application/finisher.rb:45:in `block in <module:Finisher>'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/initializable.rb:59:in `block in run_initializers'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/initializable.rb:58:in `run_initializers'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/railties-5.1.1/lib/rails/application.rb:353:in `initialize!'
from /Users/codevops/dev/auto_repairs/config/environment.rb:5:in `<top (required)>'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:92:in `require'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:92:in `preload'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/codevops/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/codevops/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
rails version 5.1.1

As you are using the latest version of rails (5.1.1) there may be an issue with the gem.
I suggest that you raise this as an issue on github: apartment gem

Related

Apartment gem giving unexpected error when generating model on Rails 5.1.0

I am new to rails platform. I'm building a multi-tenant application using Apartment gem. I'm following https://medium.com/#balogic/using-apartment-gem-to-implement-multitenant-concept-in-rails-b86f7d9e37c5 this guide to learn how to use this gem. But when i am scaffolding or generating User model i am getting the below error :
$ rails g scaffold Users email name subdomain
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.1.0/lib/action _dispatch/middleware/stack.rb:35:in `build': undefined method `new' for "Apartme nt::Elevators::Subdomain":String (NoMethodError)
Did you mean? next
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.1 .0/lib/action_dispatch/middleware/stack.rb:99:in `block in build'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.1 .0/lib/action_dispatch/middleware/stack.rb:99:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.1 .0/lib/action_dispatch/middleware/stack.rb:99:in `inject'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.1 .0/lib/action_dispatch/middleware/stack.rb:99:in `build'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/engine.rb:508:in `block in app'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/engine.rb:504:in `synchronize'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/engine.rb:504:in `app'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/application/finisher.rb:45:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/initializable.rb:59:in `block in run_initializers'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block i n 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_st rongly_connected_component_from'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block i n 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_st rongly_connected_component'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_e ach'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_e ach'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/initializable.rb:58:in `run_initializers'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/application.rb:353:in `initialize!'
from C:/Sites/multitenant_app/config/environment.rb:5:in `<top (required )>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/application.rb:329:in `require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/application.rb:329:in `require_environment!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/command/actions.rb:16:in `require_application_and_environment!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/commands/generate/generate_command.rb:19:in `perform'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li b/thor/command.rb:27:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li b/thor/invocation.rb:126:in `invoke_command'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/li b/thor.rb:369:in `dispatch'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/command/base.rb:63:in `perform'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/command.rb:44:in `invoke'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.0 /lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
**Note : ** My Rails version is 5.0.1 and Ruby version is 2.3.0
Change this line Rails.application.config.middleware.use 'Apartment::Elevators::Subdomain' removing quotation marks.
Reference:
https://github.com/influitive/apartment/pull/422
Add the below line in application.rb file
require 'apartment/elevators/subdomain'
Add below line in application.rb file inside Application class
config.middleware.use Apartment::Elevators::Subdomain

omniauth facebook uninitialzed constant error

I am following the rails cast video here but when I try run my server I am getting a error "uninitialized constant OmniAuth (NameError)". When I remove this file the server starts and the home page is shown except the link to facebook login authentication returns a routing error "No route matches [GET] "/auth/facebook" of course.
My question is similar to this stackoverlfow question here but mine is in development mode.
All code is the same I am wodnering what this is. Please help!
Full error is
C:/Sites/blog/config/initializers/omniauth.rb:1:in `<top (required)>': uninitialized constant OmniAuth (NameError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:652:in `block in load_config_initializer'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:651:in `load_config_initializer'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:615:in `each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/engine.rb:615:in `block in <class:Engine>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in `tsort_each_child'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:413:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
from C:/Sites/blog/config/environment.rb:5:in `<top (required)>'
from C:/Sites/blog/config.ru:3:in `require'
from C:/Sites/blog/config.ru:3:in `block in <main>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from C:/Sites/blog/config.ru:in `new'
from C:/Sites/blog/config.ru:in `<main>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/server.rb:61:in `app'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/server.rb:139:in `log_to_stdout'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/server.rb:78:in `start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Also if the /initializers/omniauth.rb is in its folder I cannot generate the user model I need to remove it to even do this?
I have the latest version of omniauth-facebook gem installed and ran bundle install.
do you have both omniauth and omniauth-facebook in your gemfile? like:
gem 'omniauth'
gem 'omniauth-facebook'

Elastic Beanstalk Rails deploy mystery initialize error

I am trying to deploy an existing heroku app to EC2 using Beanstalk.
So far I have all the Environment variables moved over and the database setup.. etc. It seems to work and deploy correct except for Puma.
The puma.log file has the following in it over and over;
/opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `initialize': no implicit conversion of nil into String (TypeError)
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `new'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/pathname.rb:397:in `join'
from /var/app/current/config/initializers/cloudfront-signer.rb:2:in `block in <top (required)>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/cloudfront-signer-2.2.0/lib/cloudfront-signer.rb:108:in `configure'
from /var/app/current/config/initializers/cloudfront-signer.rb:1:in `<top (required)>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `call'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /var/app/current/config/environment.rb:5:in `<top (required)>'
from config.ru:3:in `require'
from config.ru:3:in `block in <main>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/configuration.rb:102:in `load_rackup'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/configuration.rb:69:in `app'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/runner.rb:123:in `app'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/runner.rb:130:in `start_server'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:213:in `worker'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `block (2 levels) in spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `fork'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:109:in `block in spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:105:in `times'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:105:in `spawn_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:157:in `check_workers'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cluster.rb:421:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/lib/puma/cli.rb:216:in `run'
from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/puma-2.11.2/bin/puma:10:in `<top (required)>'
from /opt/rubies/ruby-2.2.2/bin/puma:23:in `load'
from /opt/rubies/ruby-2.2.2/bin/puma:23:in `<main>'
I have no clue what this is or why its happening and am at a complete loss..
Line 5 of config/environment is Rails.application.initialize!
Line 3 of config.ru is run Rails.application
So does this mean that Rails.application hasn't been defined? I'm a tad confused.
Again this app works perfectly on Heroku.
Suggestions?

Have trouble with migration after uninstalling Devise gem

I tried installing devise but ran into a lot of migration issues so went ahead and uninstalled the gem. I tried running rake:db migrate, redo, reset, and drop and I still get this error even without Devise:
/Users/ashleighalmeida/mixi/config/initializers/devise.rb:3:in `<top (required)>': uninitialized constant Devise (NameError)
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /Users/ashleighalmeida/mixi/config/environment.rb:5:in `<top (required)>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:92:in `preload'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
How do I completely remove Devise from my migration? Thanks!
Seems like you forgot to remove Devise initializer, which lies here:
config/initializers/devise.rb

Rspec 3 with devise: uninitialized constant Devise (NameError)

I am trying to set up rails_rspec with devise.
When I run: rspec all the tests run fine.
When I try with bundle exec rspec I get: config/initializers/devise.rb:3:in `': uninitialized constant Devise (NameError)
The error happens in the initializer file, I have devise in my gemfile. I'm using rails 4 with Devise version 3.4.1 and Rspec version 3.2.0.
Here's the full trace:
/Users/glesauteur/Marc/gigmarket/config/initializers/devise.rb:3:in `<top (required)>': uninitialized constant Devise (NameError)
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `call'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /Users/glesauteur/Marc/gigmarket/config/environment.rb:5:in `<top (required)>'
from /Users/glesauteur/Marc/gigmarket/spec/rails_helper.rb:4:in `require'
from /Users/glesauteur/Marc/gigmarket/spec/rails_helper.rb:4:in `<top (required)>'
from /Users/glesauteur/Marc/gigmarket/spec/models/client_spec.rb:1:in `require'
from /Users/glesauteur/Marc/gigmarket/spec/models/client_spec.rb:1:in `<top (required)>'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/glesauteur/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
from /Users/glesauteur/.rbenv/versions/2.2.1/bin/rspec:23:in `load'
from /Users/glesauteur/.rbenv/versions/2.2.1/bin/rspec:23:in `<main>'

Resources