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 Relationships

Can't install shoulda-matchers gem

I'm using the Treehouse VM on a Windows box to build the todo list app in Rails, but having trouble installing the gem "shoulda-matches".

I included gem 'shoulda-matchers' in the test group of my gem file. When I run bundler I get the following messages"

Fetching source index from https://rubygems.org/ Could not fetch specs from https://rubygems.org/

To troubleshoot the problem, I visited the Rubygems website at https://rubygems.org/gems/shoulda-matchers. I followed instructions on that site and changed my gem file to:

gem 'shoulda-matchers', '~> 2.7.0'

then, I ran the command "gem install shoulda-matchers." I got another error message:

Could not find a valid gem "shoulda-matchers" (>= 0), here is why: Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)

I also took the following actions:

Searched Treehouse forums. One poster appeared to have the same problem. He resolved the issue, but could not explain how he resolved it.

https://teamtreehouse.com/forum/in-odot-project-bundle-command-fails-when-shouldamatchers-is-added-to-gemfile

Searched stackoverflow. I found questions about problems related to installation of gems, but nothing specific about the "shoulda-matchers" gem. At this stage of my Rails journey, many treads on stackoverflow are above my knowledge/comprehension grade. :)

Can someone please guide me in the right direction to hurtle this setback? I want to finish the Todo list app using the Treehouse VM on my Windows box.

7 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

This sometime happens to gems in general. Try again in a few hours and perhaps it will work. Also, please try running this command in the terminal:

gem install shoulda-matchers -v 2.7.0

Maybe this will download it.

Maciej -

I tried gem install shoulda-matchers -v 2.7.0, but that does not solve the problem, I get the same error message: Could not find a valid gem ...."

Using bundle command alone still does not work either. The error is "could not find gem ...."

Any ofter suggestions?

Thanks,

Ronald

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, try these things (especially the second answer with gem sources -a http://rubygems.org), I remember that changing from https to http solved the problem for some people:

http://stackoverflow.com/questions/23035980/gem-error-to-install

Hi Maciej,

Thanks for your help, however, I decided to natively install the Ruby/Rails environment on one of my Linux boxes. Afterwards, I was able to installed the shoulda-matchers gem without incident. I copied all my my todo list app files to my Linux box. So far, everything works great on Linux. For me, use of the Treehouse VM on Windows was simply too problematic/buggy.

Once again, thank you for the suggestions and help troubleshooting the VM.

Best regards,

Ronald

James demby
James demby
10,296 Points

Do you guys have any advice on setting up a lenux box? I am running into the same thing.

Is there anyone using windows who does not run into this?

Thanks for the post, this is the only thing I could find on this subject, and it would be great if it was attached to the video where someone would run into this.

http://teamtreehouse.com/library/build-a-todo-list-application-with-rails-4/build-a-todo-list-application-with-rails-4/set-up-git-and-add-gems

Cheers,

Hi James -

Visit this website and follow the instructions for installing Ruby / Rails environment on a Linux box: http://guides.railsgirls.com/install/#setup-for-linux Note that the Linux instructions are about mid-way down the page.

Yeah, I got frustrated trying to run my Ruby/Rails environment on a Windows laptop, even including with the Treehouse VM. Too many problems. Since migrating to Linux, I haven't had any issues. In fact, I just installed MySQL server and workbench, which is required for the Database Foundations course after you finish the To-Do list app.

Good luck to you!

Best regards,

Ronald

James demby
James demby
10,296 Points

Thanks Ronald,

I actually just got gem install shoulda-matchers -v 2.7.0

to work, but the second it starts acting up on me again I am headed to Linux.

Cheers!

Hi again, James

If you do migrate your development environment to Linux, I think you'll love it. I won't be going back to a Windows-based Rails development environment!

Happy coding!

Ronald

James demby
James demby
10,296 Points

Yeah...... that did not last long!

I am using Nitrous and my whole life is better.

The one thing I am not liking as much as CMDR is that I cannot scroll up and down in the command window.

But everything works now!

Thanks a lot!

James -

I've heard good things about Nitrous, but I haven't used it. I have used a cloud-based development environment called Cloud 9. I like it a lot. If you ever want to try it, just go to https://c9.io/ and check it out. Heroku (for hosting) works great with Cloud 9 too.

I agree ... CMDR is a really good command line utility.

On another note .... If you ever want to go the duel boot route .... it's a straightforward set-up with Ubuntu's installation process.

Enjoy,

Ronald

I don't know if this will offer any help or not. I was just going through the same challenges with my Linux machine. I watched the video carefully and tried to type in my code exactly the same as it should have been. I must have looked at it ten or more times. I finally looked one last time at the way I typed "shoulda-matchers." I left the 'a' off the end of "shoulda."

Now I am too tired to continue for the night.

For those of you still using Windows: if you get a 'certificate verify failed' message when trying to install shoulda-matchers, this link worked for me:

[https://gist.github.com/luislavena/f064211759ee0f806c88]

You will need to add a new trust certificate. The instructions are easy to follow.