Question

Sorry if this is a bad question, I'm trying to initially set up Rails, so I don't really know what I'm doing. In the tutorial I'm following it comes to a point at which is says to run "rails server," however this is returning some unexpected results.(See below)

Macbookpro:First Cameron$ sudo rails server
Password:
=> Booting WEBrick
=> Rails 4.1.0 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
/Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `action_mailer' for #<Rails::Application::Configuration:0x007fea90b47760> (NoMethodError)
    from /Users/admin/Rails/First/config/environments/development.rb:17:in `block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie.rb:210:in `instance_eval'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie.rb:210:in `configure'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie.rb:182:in `configure'
    from /Users/admin/Rails/First/config/environments/development.rb:1:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
    from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/engine.rb:593:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/engine.rb:593:in `block in <class:Engine>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/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:210:in `block (2 levels) in each_strongly_connected_component_from'
    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:209:in `block in each_strongly_connected_component_from'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:44:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:203: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.1.0/lib/rails/initializable.rb:54:in `run_initializers'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie.rb:194:in `public_send'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/railtie.rb:194:in `method_missing'
    from /Users/admin/Rails/First/config/environment.rb:5:in `<top (required)>'
    from /Users/admin/Rails/First/config.ru:3:in `require'
    from /Users/admin/Rails/First/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 /Users/admin/Rails/First/config.ru:in `new'
    from /Users/admin/Rails/First/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.1.0/lib/rails/commands/server.rb:50: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.1.0/lib/rails/commands/server.rb:130:in `log_to_stdout'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands/server.rb:67:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Sorry if this is not needed, but I'm really unsure what to do with it.

Was it helpful?

Solution

I don't think you're alone in this error. Make sure you coordinate your gem versions, and even better if specify the versions of your Rails & Ruby gems to avoid potential conflicts in versioning.

Posting your Gemfile would be helpful, but without seeing it, I'd say to specify your Ruby version at the top of your gemfile like:

source 'https://rubygems.org'
ruby '2.0.0'

Then specify your version of Rails. While I have had no problems with just providing:

gem 'rails'

You could be extra safe and specify a version like:

gem 'rails', '4.0.2'

Then run: bundle install for your app.

OTHER TIPS

Take a look at the following tutorial. I realise that it is for windows however it solved all the initial problems I was having with my first install.

http://www.soheiokamoto.com/setting-up-ruby-on-rails-on-windows

The main point that helped me install perfectly was;

Run gem update on a fresh install to make sure everything is up to date

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top