omniauth facebook uninitialzed constant error - ruby-on-rails

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'

Related

Rails Apartment gem error generate model

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

Not able to start rails server in 5.0.0.1 rails but works fine with 4.2.0.beta1

I am still learning ROR and I have spent a lot of time trying to figure it out.
I have tried to install all sorts of gems from different stackoverflow answers. Is there anyone that can help me with this? Thank You
How can I get to work with the latest version (5.0.0.1) it says:
=> Booting WEBrick
=> Rails 4.2.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/ubuntu/workspace/hellp_app/config/environments/development.rb:53:in `block in <top (required)>': uninitialized constant ActiveSupport::EventedFileUpdateChecker (NameError)
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/railtie.rb:210:in `instance_eval'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/railtie.rb:210:in `configure'
from /home/ubuntu/workspace/hellp_app/config/environments/development.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/engine.rb:598:in `block (2 levels) in <class:Engine>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/engine.rb:597:in `each'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/engine.rb:597:in `block in <class:Engine>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `each'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
from /home/ubuntu/workspace/hellp_app/config/environment.rb:5:in `<top (required)>'
from /home/ubuntu/workspace/hellp_app/config.ru:3:in `require_relative'
from /home/ubuntu/workspace/hellp_app/config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /home/ubuntu/workspace/hellp_app/config.ru:in `new'
from /home/ubuntu/workspace/hellp_app/config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/ubuntu/workspace/hellp_app/bin/rails:9:in `require'
from /home/ubuntu/workspace/hellp_app/bin/rails:9:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/ubuntu/workspace/hellp_app/bin/spring:13:in `require'
from /home/ubuntu/workspace/hellp_app/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
In the gemfile you posted, the Rails version is incorrect:
gem 'rails', '4.2.2'
Since you are attempting to start version 5.0.0.1, you should update it accordingly in your gemfile, then run:
bundle install
to install dependendies for the newest version.

ActiveAdmin and Rails 4 creating a model resource broke my project

I was following the instructions at http://www.activeadmin.info/docs/0-installation.html#gemfile under the heading Register your models with Active Admin. Before adding the resource of Post I was able to start my server just fine. Once I added the resource of Post, it would no longer start. It was giving me an error about the I18n.config.enforce_available_locales needing to be set to false to prevent the error message. I found another Stack Overflow post which said to set this to false in the application.rb file. After doing this the message no longer shows in my Terminal interface, but the servers don't start.
Now I am getting the following output in Terminal when I run $ rails server
/Applications/MAMP/htdocs/ruby-review/app/admin/post.rb:1:in `<top (required)>': uninitialized constant Post (NameError)
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/application.rb:179:in `load'
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/application.rb:171:in `block in load!'
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/application.rb:171:in `each'
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/application.rb:171:in `load!'
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/application.rb:195:in `routes'
from /Library/Ruby/Gems/2.0.0/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin.rb:80:in `routes'
from /Applications/MAMP/htdocs/ruby-review/config/routes.rb:3:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
from /Library/Ruby/Gems/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:319:in `draw'
from /Applications/MAMP/htdocs/ruby-review/config/routes.rb:1:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/file_update_checker.rb:75:in `call'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/file_update_checker.rb:75:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/application.rb:215:in `initialize!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Applications/MAMP/htdocs/ruby-review/config/environment.rb:5:in `<top (required)>'
from /Applications/MAMP/htdocs/ruby-review/config.ru:3:in `block in <main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Applications/MAMP/htdocs/ruby-review/config.ru:in `new'
from /Applications/MAMP/htdocs/ruby-review/config.ru:in `<main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:48:in `app'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:75:in `start'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
How to I initialize the Constant of Post?
My apologies if these errors seem obvious to some. I am still new to rails.
You have to have a Post model. Do this:
$ rails g model Post
$ rake db:migrate

unable to run rails server after updating to rails 4

I just now my rails app to rails 4 from rails 3. I am not able to get it to work. I have done all the necessary configuration removal and addition whereever necessary. But now I am facing this. IS the question too blunt? IF so comment on what information is needed to make it more understandable. I am a totally new to rails, please help.
/home/aravind/Documents/dev/ptl/config/initializers/simple_form.rb:8:in `block in <top (required)>': undefined method `wrappers' for SimpleForm:Module (NoMethodError)
from /usr/local/lib/ruby/gems/2.0.0/gems/simple_form-1.4.1/lib/simple_form.rb:143:in `setup'
from /home/aravind/Documents/dev/ptl/config/initializers/simple_form.rb:2:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /usr/local/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/local/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /usr/local/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `tsort_each_child'
from /usr/local/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /usr/local/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /usr/local/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/aravind/Documents/dev/ptl/config/environment.rb:5:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /home/aravind/Documents/dev/ptl/config.ru:3:in `block in <main>'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/aravind/Documents/dev/ptl/config.ru:in `new'
from /home/aravind/Documents/dev/ptl/config.ru:in `<main>'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
it looks like you are running simple_form 1.4.1 try upgrading it to the latest version. which should work with rails 4. if you are specifying a version in your Gemfile remove the version tag, and run bundle update
Give this a go gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'. I think you need a more recent version of simple_form.

Rails server not starting - rails 4.0.0.rc1

I am following the tutorial on http://ruby.railstutorial.org/ and now I am not able to start the server. In my gemfile I am using ruby 2.0.0 and rails 4.0.0.rc1 - then I tried changing back to ruby 1.9.3 and rails 3.2.13 - still not working
this is what terminal tells me:
/config/environments/development.rb:1:in `<top (required)>': uninitialized constant FourTest (NameError)
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/engine.rb:590:in `each'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:30:in `run'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:44:in `each'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/markustorok/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application.rb:214:in `initialize!'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/markustorok/Dropbox/2Working/WebDesign/Ruby/rails_projects/speiseplan/config/environment.rb:5:in `<top (required)>'
from /Users/markustorok/Dropbox/2Working/WebDesign/Ruby/rails_projects/speiseplan/config.ru:3:in `require'
from /Users/markustorok/Dropbox/2Working/WebDesign/Ruby/rails_projects/speiseplan/config.ru:3:in `block in <main>'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/markustorok/Dropbox/2Working/WebDesign/Ruby/rails_projects/speiseplan/config.ru:in `new'
from /Users/markustorok/Dropbox/2Working/WebDesign/Ruby/rails_projects/speiseplan/config.ru:in `<main>'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands/server.rb:48:in `app'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands/server.rb:75:in `start'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:80:in `block in <top (required)>'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
from /Users/markustorok/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Do you have any initialisers or lines in config files that make a call to a FourTest class? Because that class can't be found. Start by searching your code for FourTest then check that you've followed naming conventions on the file that contains the class and that it's in a folder that gets loaded by default (models folder) or that you are manually loading it before using it (lib folder, etc).

Resources