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 trialYuan Tang
14,168 Pointscannot find rspec directory
first i tried bin/rails generate rspec:install and it said "could not find generator rspec:install" then i tried the following: gem install rspec gem install rspec-rails
but by installing the gem this way it didn't generate a folder for rspec
Any help would be appreciated.
4 Answers
Robert Ho
Courses Plus Student 11,383 PointsHey Yuan,
I noticed something is wrong with your gem file. To the right of the "SDOC" gem, I see that you have an unclosed "group: :doc" rails method. Remove that, , save, and run bundle install again. Then do the bin/rails generate rspec:install command again.
For reference to what I'm talking about:
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc ## <-- OVER HERE
gem 'tzinfo-data', platforms: [:mingw, :mswin]
group :doc do
# bundle exec rake doc:rails generates the API under doc/api
gem 'sdoc', require: false
end
group :development, :test do
gem 'rspec-rails', '~> 2.0'
end
group :test do
gem 'capybara', '~> 2.1.0'
end
Let me know if that helped
thomascawthorn
22,986 PointsIt was a little while ago since I did this course, but I think the 'spec' folder is created manually (mkdir spec).
Have you added rspec to your gem file and run bundle?
Yuan Tang
14,168 PointsYes I have added them to my gem file and run bundle. In the video, spec folder was created by the command gem install rspec gem install rspec-rails.
Yuan Tang
14,168 Pointsafter I typed bundle, it didn't show any gem called rspec installed. But I did add them in my Gemfile. Here is a copy of it. (this could not show up properly here, losing its format) source 'https://rubygems.org'
gem 'rails', '4.1.1' gem 'sqlite3' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'tzinfo-data', platforms: [:mingw, :mswin]
group :doc do # bundle exec rake doc:rails generates the API under doc/api gem 'sdoc', require: false end
group :development, :test do gem 'rspec-rails', '~> 2.0' end
group :test do gem 'capybara', '~> 2.1.0' end
thomascawthorn
22,986 PointsAbove the 'post answer' button is a link to the Markdown Cheatsheet. This shows you how to add code to your forum post :-)
Yuan Tang
14,168 Pointssource 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]
group :doc do
# bundle exec rake doc:rails generates the API under doc/api
gem 'sdoc', require: false
end
group :development, :test do
gem 'rspec-rails', '~> 2.0'
end
group :test do
gem 'capybara', '~> 2.1.0'
end
thomascawthorn
22,986 PointsGem file looks okay to me.. But I'm not that experienced.
Just to confirm, you added the gem to your gem file, ran bundle, then called
"bin/rails generate rspec:install"
?
Try with bundle install and bundle update, it sounds like the gem isn't being installed via your gemfile + bundle
Yuan Tang
14,168 PointsI just tried it but the rspec did not show up
thomascawthorn
22,986 PointsI think Dino PaΕ‘kvan might be able to give much better help
Yuan Tang
14,168 PointsYuan Tang
14,168 PointsThanks Robert, I just tried but it still didn't work. It makes no difference for some reason.
Robert Ho
Courses Plus Student 11,383 PointsRobert Ho
Courses Plus Student 11,383 PointsCan you copy and paste your entire gem file after making the changes? Also, do you still get the same error?
Yuan Tang
14,168 PointsYuan Tang
14,168 Points''' source 'https://rubygems.org'
gem 'rails', '4.1.1' gem 'sqlite3' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', gem 'tzinfo-data', platforms: [:mingw, :mswin]
group :doc do # bundle exec rake doc:rails generates the API under doc/api gem 'sdoc', require: false end
group :development, :test do gem 'rspec-rails', '~> 2.0' end
group :test do gem 'capybara', '~> 2.1.0' end '''
Thanks a lot. Yes, I still get the same error. Will this problem be related to my Windows 8 x64 machine? I am using treehouse VM.
thomascawthorn
22,986 Pointsthomascawthorn
22,986 PointsHave you tried copying and pasting from the project files? If it doesn't work after that - you know you've got a problem somewhere else!
Robert Ho
Courses Plus Student 11,383 PointsRobert Ho
Courses Plus Student 11,383 PointsHey Yuan,
I noticed that you have a comma right after gem 'sdoc' '~0.4.0', You should remove that comma and try the steps above. In summary:
For reference:
Hope this works! Haha.
Yuan Tang
14,168 PointsYuan Tang
14,168 PointsSadly it's still not working. Really appreciate it for your time though.