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 Write Our First Tests

Nolan Dalton
Nolan Dalton
1,589 Points

Rpsec + Syntax Issue

Getting this load error and a syntax one, not sure what I'm doing wrong:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in load': C:/Sites/odot/spec/features/todo_lists/create_spec.rb:33: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:inblock in load_spec_files' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in each' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:inload_spec_files' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:102:in setup' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:88:inrun' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:73:in run' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:41:ininvoke' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/exe/rspec:4:in <top (required)>' from C:/RailsInstaller/Ruby2.1.0/bin/rspec:23:inload' from C:/RailsInstaller/Ruby2.1.0/bin/rspec:23:in `<main>'

Code: https://github.com/NolanDalton/rspec-syntax-issue

2 Answers

C:/Sites/odot/spec/features/todo_lists/create_spec.rb:33: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)

You are missing an 'END' somewhere in the create_spec.rb around or after line 33.

Nolan Dalton
Nolan Dalton
1,589 Points

What about the load error?

The reason for the load error is the syntex error. When you fix the syntex error it will then load or give you a new error to chase down. The first issue is that there is an 'END' missing.

This:

C:/Sites/odot/spec/features/todo_lists/create_spec.rb:33: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)

Is the cause for this:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in load': 
Nolan Dalton
Nolan Dalton
1,589 Points

Fixed the end but now getting one with the helper on line 1

C:/RailsInstaller/Ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- rails_helper (LoadError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from C:/Sites/odot/spec/features/todo_lists/create_spec.rb:1:in <top (required)>' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:inload' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in block in load_spec_files' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:ineach' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in load_spec_files' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:102:insetup' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:88:in run' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:73:inrun' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:41:in invoke' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.1/exe/rspec:4:in<top (required)>' from C:/RailsInstaller/Ruby2.1.0/bin/rspec:23:in load' from C:/RailsInstaller/Ruby2.1.0/bin/rspec:23:in<main>'

Code is on the GitHub repo I linked