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

Rails Installer issues?

I've been following along with the build a simple ruby app, and after fixing a syntax error last night everything was working fine. I go to my terminal to run a rails server today and this is the code I'm getting:

Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:469:in `load': C:/Sites/Treebook/app/models/user.rb
:19: syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' (Synta
xError)
 has_many :statuses
       ^
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:469:in `block in load_file'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:639:in `new_constants_in'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:468:in `load_file'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:353:in `require_or_load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:190:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/inflector/methods.rb:229:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:554:in `get'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:588:in `constantize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise.rb:285:in `get'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/mapping.rb:77:in `to'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/mapping.rb:72:in `modules'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/mapping.rb:89:in `routes'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/mapping.rb:156:in `default_used_route'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/mapping.rb:66:in `initialize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise.rb:319:in `new'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise.rb:319:in `add_mapping'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/rails/routes.rb:210:in `block in devise_for'
       from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/rails/routes.rb:209:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.1.0/l
ib/devise/rails/routes.rb:209:in `devise_for'
       from C:/Sites/Treebook/config/routes.rb:2:in `block in <top (required)>'

        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2
.13/lib/action_dispatch/routing/route_set.rb:289:in `instance_exec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2
.13/lib/action_dispatch/routing/route_set.rb:289:in `eval_block'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2
.13/lib/action_dispatch/routing/route_set.rb:267:in `draw'
        from C:/Sites/Treebook/config/routes.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:245:in `load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:245:in `load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:40:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:16:in `reload!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:26:in `block in updater'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/file_update_checker.rb:78:in `call'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/file_update_checker.rb:78:in `execute'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/routes_reloader.rb:27:in `updater'
        from C:in `execute_if_updated'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:54:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application.rb:136:in `initialize!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from C:/Sites/Treebook/config/environment.rb:5:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
           from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
   3.2.13/lib/active_support/dependencies.rb:251:in `require'
            from C:/Sites/Treebook/config.ru:3:in `block in <main>'
            from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
/rack/builder.rb:51:in `instance_eval'



        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
   /rack/builder.rb:51:in `initialize'
            from C:/Sites/Treebook/config.ru:in `new'
            from C:/Sites/Treebook/config.ru:in `<main>'
            from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
   /rack/builder.rb:40:in `eval'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
    /rack/builder.rb:40:in `parse_file'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
   /rack/server.rb:200:in `app'
          from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
  3/lib/rails/commands/server.rb:46:in `app'
           from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
  /rack/server.rb:304:in `wrapped_app'
          from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib
   /rack/server.rb:254:in `start'
           from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
   3/lib/rails/commands/server.rb:70:in `start'
          from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
   3/lib/rails/commands.rb:55:in `block in <top (required)>'
           from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
   3/lib/rails/commands.rb:50:in `tap'
           from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
   3/lib/rails/commands.rb:50:in `<top (required)>'
           from script/rails:6:in `require'
           from script/rails:6:in `<main>'

What the heck is going on here?

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Brian Goldstein, what's on line 19 of your app/models/user.rb file? That is what seems to be causing the error here. Can you paste it?

sure:

whole file:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
          :recoverable, :rememberable, :trackable, :validatable

   # Setup accessible (or protected) attributes for your model
   attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :profile_name 
   # attr_accessible :title, :body

  validates :first_name, presence: true

 validates :last_name, presence: true

 validates :profile_name, presence: true,
                       uniqueness: true, 


  has_many :statuses

  def full_name
   first_name + " "+ last_name
  end
end

Just noticed a small syntax error above it, but line 19 is the "has_many: statuses" line.