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 Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Mac

House Trigo
House Trigo
36,620 Points

Can't create a new testapp with Rails

When I enter "rails new testapp" in the terminal, I get the following error:

Errno::EACCES: Permission denied @ dir_s_mkdir - /Users/MyName/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/json-1.8.2
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.
         run  bundle exec spring binstub --all
bundler: command not found: spring
Install missing gem executables with `bundle install`

I don't get what seems to be the problem here. I've spent four hours looking up the solution but had no luck.

I'm running OSX Yosemite with Ruby 2.2.0 installed along with Rails 4.2.0

Ross Litzenberger
Ross Litzenberger
11,706 Points

I have fell into this same problem. Rbenv rehash. This should do the trick. If it doesn't. I would uninstall that version of ruby. Then reinstall rbenv install 2.2.0 then call "rbenv rehash" before installing another gem.

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

I can see from the output that you're using rbenv, unfortunately I had no experience with rbenv, I only use rvm, and never have any problem.

Maybe give rvm a try see if things work out?