Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Relationships

Tracy Bowen
Tracy Bowen
8,526 Points

rake aborted! syntaxError

when i apply bin/rake spec, this is the message printed.

rake aborted! SyntaxError: /home/treehouse/projects/odot/config/application.rb:9: class/module name must be CONSTANT /home/treehouse/projects/odot/Rakefile:4:in require' /home/treehouse/projects/odot/Rakefile:4:in<top (required)>' (See full trace by running task with --trace)

line 9 module odot

Seth Kroger
Seth Kroger
56,412 Points

The error message is pointing to a problem in the config/application.rb file at line 9. Could you post the code from that file so we can see what the problem is?

Tracy Bowen
Tracy Bowen
8,526 Points

Line 9 module odot

Tracy Bowen
Tracy Bowen
8,526 Points
require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

module odot 
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
    end
end

[Mod - edited for formatting]

3 Answers

Tracy Bowen
Tracy Bowen
8,526 Points

The module name should be capitalized; module Odot, not module odot. That's just one of the naming rules

Would need to see your code but it looks like a name error. Ensure you are using doing it the rails way. For instance of say 'Users'. Naming conventions for Model would be 'User' and controller would be 'UsersConroller'. Take note of the capital letters and pluralisation.

Tracy Bowen
Tracy Bowen
8,526 Points

require File.expand_path('../boot', FILE)

require 'rails/all'

Require the gems listed in Gemfile, including any gems

you've limited to :test, :development, or :production.

Bundler.require(:default, Rails.env)

module odot class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end

end

Seth Kroger
Seth Kroger
56,412 Points

The module name should be capitalized; module Odot, not module odot. That's just one of the naming rules.

Tracy Bowen
Tracy Bowen
8,526 Points

Thank you Seth, that solved the issue.