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

JSON Gem Rails Error

Hey Guys, Every time I use a project that requires the son gem, I get the following error. I've ran bundle install, bundle update, gem install son, gem install son -v '1.8.0' and NOTHING works! It's driving me cray!

An error occurred while installing json (1.8.0), and Bundler cannot continue. Make sure that gem install json -v '1.8.0' succeeds before bundling.

I hope someone has a solution!

What version of Ruby are you using?

What version of Ruby did you install? If you installed the latest update then you need to downgrade. It worked for me by using 2.0.0p643.

Using ruby version 2.2.0p0 (this is what I get from ruby -v): ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] How do I downgrade?

Go to your Control Panel and uninstall the Ruby and reinstall another version.

1 Answer

John Salzarulo
John Salzarulo
6,596 Points

I'd recommend using "ruby env". Learning this has helped me manage ruby versions and dependencies.