Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Write Our First Tests

Can't run bin/rspec spec/features/todo_lists/create_spec.rb

Hey!

When I try to run the command <code>bin/rspec spec/features/todo_lists/create_spec.rb</code> from my command prompt on windows 8.1 I get the error <code>'bin' is not recongnized as an internal or external command, operable program or batch file.</code>

Is there a way to fix this? It does not work to <code>cd</code> into the bin dir and then run <code>rspec ../spec/features/todo_lists/create_spec.rb</code>

Thanks, Fredrik A. Madsen-Malmo

3 Answers

Hey Fredrik (eller Hallo, hvordan har du det!),

I had the same issue. It turns out (if I am not mistaken) that Jason Seifer simply has his directories set up differently than what we might have it. Thus, simply drop the bin and you'll be all set. This is what I did, and it's worked like a charm ever since; I've had no issues continuing the lessons.

I hope this helps. :)

Aha, thanks for clearing that up. During the course I ran into a ton of problem with outdated gems which were no longer availible, so I ended up quitting the course and going back to front-end development.

Langt mellom nordmennene her :)

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

This is the same as your other question in that Rspec is not on your system PATH. You're not meant to have to be in any particular directory or have to to specify 'bin' to use these commands. It seems your Ruby / Rails environment may not have been set up correctly - all gems you install (such as Rspec in this case) should automatically be added to your Path rather than having to add them manually. Maybe look into using RVM to manage your Ruby and gems as this should ensure everything you need is on your Path.

Hey, would you recommend me using my MacBook instead of Windows? I have heard that this is supposed to be easier. If that is the case, should I still use RVM?

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

Absolutely yes - Mac makes life a lot easier for Ruby development (and development in general really - most Ruby companies exclusively use either Mac or Linux ) than Windows, which can be a confusing nightmare sometimes, so its not surprising you've run into issues like this. And yeah, RVM is still great for Mac.

Well, shit. I've been trying for a couple of hours now to fix the <code>PATH</code> issue without any success. Decided to grab my MacBook Air and everything works like a charm. God damn it

David Gross
David Gross
19,443 Points

Have you checked in your terminal if its in the bin directory ?

 which rspec 

Thanks for the quick answer. I'll check this when I get home.