I am faced with the error below when starting the rails server:
Uncaught exception: undefined method `formatter' for nil:NilClass
There is another StackOverflow question, NoMethodError on Rails Server which suggests to add require './app'
to the config.ru
file, however that solution did not work for me (it resulted in an error.)
I also tried adding in the logger
gem to my gemfile, as I recently uninstalled all gems to resolve this issue.
The exact console output is as follows:
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/server.rb:142:in `log_to_stdout'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/server.rb:78:in `start'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in `block in server'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/daniel/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
/home/daniel/Data/RubyOnRails/YoutubeBlog/bin/rails:4:in `require'
/home/daniel/Data/RubyOnRails/YoutubeBlog/bin/rails:4:in `<top (required)>'
Exiting
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
I deleted the Gemfile, ran bundle install
and bundle update
which did not solve the problem. (Thanks for the suggestions).
Any help would be appreciated. :|