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 Set up Git and Add Gems

Unable to generate rspec using this command: rails generate rspec:install

I have made the changes to the Gemfile. Bundle was successful. I receive the following error message from 'rails generate rspec:install. I am using rails-4.2.0, bundler-1.7.11, rake-10.4.2. Any help would be appreciated!

C:\Users\AnnieD\treehouse\odot (master) λ rails generate rspec:install DL is deprecated, please use Fiddle C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rspec-3.1.0/lib/rspec.rb:1:in require': cannot load such file -- rspec/core (LoadError) from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rspec-3.1.0/lib/rspec.rb:1:in<top (required)>' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:in require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:inblock (2 levels) in require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:in each' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:inblock in require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:in each' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:inrequire' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.11/lib/bundler.rb:134:in require' from C:/Users/AnnieD/treehouse/odot/config/application.rb:7:in<top (required)>' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in require' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:inrequire_application_and_environment!' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:128:in generate_or_destroy' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:50:ingenerate' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!' from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in<top (required)>' from bin/rails:4:in require' from bin/rails:4:in<main>'

7 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Assuming everything else is OK, you probably need to stop Spring and run the rspec install command again:

https://github.com/rspec/rspec-rails/issues/996

In the terminal:

spring stop

rails generate rspec:install

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

But...since you're using Windows, I strongly recommend moving to a Unix-based system for Rails development (free Ubuntu Linux using free VMWare Player is the easiest solution that I personally use almost every day) or set up a free Cloud9 account and develop online (this can help: https://www.railstutorial.org/book/beginning#sec-up_and_running ). Developing Rails under Windows will be hard on you and you will get less support and help since most people don't use Windows for Rails.

The command 'spring stop' generated this error message

Spring not recognized as an internal or external command.

I am working in the treehouse vm.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Do you have spring gem in the gemfile?

I just installed it. When I execute 'spring stop', message says spring is not running.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, so it's not a problem with spring apparently. Please google the error and try various solutions that people give online. Try restarting the VM and trying again etc.

I've tried all of that and more. But thank you for your help.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

In this case consider using Cloud9 or setting up your own, better VM using VMWare Player - this way you will get experience with installing your own Linux system from scratch and setting up your very own Rails development environment on it. I say "better VM", because the Treehouse VM is weird and harder to troubleshoot.

I agree with your assessment about RoR development on Windows. It was my intention to work through the treehouse tutorial using the treehouse vm on Windows, and then later set up a local development environment on Ubuntu. I've programmed alot under Windows before (C++), so I am comfortable with it. But RoR is probably meant for Linux. With all of your points, it seems you've done a lot of tracks on treehouse. Did you use the treehouse vm when you were completing the Ruby track?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

No, I never used Treehouse VM, because it was confusing and problems described by people who used it on this forum suggested it's quite problematic. I downloaded VMWare Player, installed Ubuntu and followed a simple tutorial for setting up a full Rails environment: https://gorails.com/setup/ubuntu/14.10 (with rvm, for patriotic reasons and simplicity). It works flawlessly and you can troubleshoot things easier because it's a full-blown OS and Teehouse VM is some kind of hybrid. I keep files in sync with Windows using Dropbox.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Most Rails devs seem to prefer Mac OS (works the same way Linux does, since both are Unix-based). I will always recommend Linux though. Cloud9 that I mentioned before gives you an online Ubuntu Linux-based environment.

Awesome, thanks for this. Unless I can resolve my rspec problem, I am pretty much back at square one. Would you suggest I blow off my current development environment, and reinstall based on this ubuntu setup. I have my owner virtual Linux server - I was planning on using it for my production application, might as well use it for dev. And rvm is Polish?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

The current main dev and maintainer responsible for rvm is Polish.

It all depends on what will work for you in the long run. I had to experiment a lot before I found my way of doing things. You should give Cloud9 ( https://c9.io/ ) a try - it's free and really gives you everything you need, you can work form any computer using the browser, access git etc. It will take 10-15 minutes to set up I believe, so there's nothing to lose.

Great, thanks for your help. Have a good evening!