RSPEC Practice 1 Problem [SOLVED]

Hey all. So I was working on the RSPEC Practice 1 assignment and can’t get RSPEC to execute as a bundle. However when I run “bundle exec rspec spec/00_hello_world.rb” or any other individual rspec file, it runs without issue. Looked around the forum, but it seems most people have the opposite problem where they can run rspec on the suite but not individual files. My terminal log is posted below

Last login: Thu Oct 11 19:03:02 on ttys000
YamaBook-Pro:appacademy-online-rspec-1-9bbbc10d877d pishiyama$ bundle install
Using bundler 1.16.6
Using byebug 9.0.6
Using diff-lcs 1.3
Using rspec-support 3.2.2
Using rspec-core 3.2.3
Using rspec-expectations 3.2.1
Using rspec-mocks 3.2.1
Using rspec 3.2.0
Bundle complete! 2 Gemfile dependencies, 8 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.
YamaBook-Pro:appacademy-online-rspec-1-9bbbc10d877d pishiyama$ bundle exec rspec --color
bundler: failed to load command: rspec (/Users/pishiyama/.rbenv/versions/2.3.1/bin/rspec)
SyntaxError: /Users/pishiyama/Downloads/appacademy-online-rspec-1-9bbbc10d877d/lib/04_pig_latin.rb:8: syntax error, unexpected end-of-input, expecting keyword_end
/Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in load' /Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:inblock in load_spec_files’
/Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in each' /Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:inload_spec_files’
/Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in setup' /Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:inrun’
/Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in run' /Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:ininvoke’
/Users/pishiyama/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.2.3/exe/rspec:4:in <top (required)>' /Users/pishiyama/.rbenv/versions/2.3.1/bin/rspec:23:inload’
/Users/pishiyama/.rbenv/versions/2.3.1/bin/rspec:23:in `<top (required)>’
YamaBook-Pro:appacademy-online-rspec-1-9bbbc10d877d pishiyama$

–THANKS!

Here’s what I get when executing the rspec command for individual spec files. For some reason works A-OK

YamaBook-Pro:appacademy-online-rspec-1-9bbbc10d877d pishiyama$ bundle exec rspec spec/00_hello_spec.rb

Finished in 0.00349 seconds (files took 0.07706 seconds to load)

3 examples, 0 failures

YamaBook-Pro:appacademy-online-rspec-1-9bbbc10d877d pishiyama$

Well figured out it was because of a missing “end” for my Pig Latin loop

Now I fell dumb :slight_smile:

1 Like

No worries Yama, that happens to the best of us! I always recommend people use a linter in Atom; it helps us hunt down things like missing ends or extra parenthesis, kind of like a spell check or syntax check. It will underline code and give you hints.

It you want to install it yourself and see if it helps:

  1. Go to Atom --> preferences --> install and type linter-rubocop in the search bar.
  2. Install linter and click yes to the blue pop ups (this tells atom how to parse text and underline mistakes)
  3. Install linter-rubocop and click yes to the blue pop ups(this tells atom how to parse Ruby specifically)
  4. Open a terminal in your root directory (your home directory that you everything else lives in)
  5. type gem install rubocop (this installs the ruby gem that the linter relies on behind the scenes)
1 Like