Errno::EACCES: Permission denied in create new app ruby on rails

1.8k Views Asked by At

After install fresh ruby (v 2.2.2) and rails (v 4.2.1). i try create new app by commnad rails new app in my terminal. But print errors like this:

Errno::EACCES: Permission denied @ dir_s_mkdir - /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/byebug-5.0.0
An error occurred while installing byebug (5.0.0), and Bundler cannot continue.
Make sure that `gem install byebug -v '5.0.0'` succeeds before bundling.

After that i run bundle install . but again show same error! how to fixed this issue? Why it say Permission denied ?

Thanks.

1

There are 1 best solutions below

1
On

Try installing gem byebug with sudo privilege

sudo gem install byebug -v '5.0.0'

Enter the password to elevate the privilege.
Perhaps this would solve this issue temporarily, consider looking at this question.