Question

I have installed the gem berkshelf (2.0.10).

My Berksfile

site :opscode 
cookbook 'memcached', '~> 1.3.0'
cookbook 'redisio', '~> 1.4.1'.

I execute the command berks.

/chef-repo$ berks
/usr/local/lib/ruby/2.1.0/fileutils.rb:250:in `mkdir': Permission denied @ dir_s_mkdir - /home/likewise-open/ZOHOCORP/siva-pt130/.rvm/gems/ruby-2.1.0/extensions/x86_64-linux/2.1.0-static/eventmachine-1.0.0.beta.3 (Errno::EACCES)
from /usr/local/lib/ruby/2.1.0/fileutils.rb:250:in `fu_mkdir'
from /usr/local/lib/ruby/2.1.0/fileutils.rb:224:in `block (2 levels) in mkdir_p'
from /usr/local/lib/ruby/2.1.0/fileutils.rb:222:in `reverse_each'
from /usr/local/lib/ruby/2.1.0/fileutils.rb:222:in `block in mkdir_p'
from /usr/local/lib/ruby/2.1.0/fileutils.rb:208:in `each'
from /usr/local/lib/ruby/2.1.0/fileutils.rb:208:in `mkdir_p'
from /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:210:in `write_gem_make_out'
from /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:132:in `build_error'
from /usr/local/lib/ruby/2.1.0/rubygems/ext/builder.rb:171:in `rescue in build_extension'
Was it helpful?

Solution

If you are using the system ruby, you need to run:

sudo berks

OTHER TIPS

This is an issue with bundler/rubygems 2.2. See bundler#2847. The suggested solution is to downgrade to rubygems 2.1.

I had this issue as well, and was able to resolve it with:

sudo chown -R myusername:staff /Users/myusername/.berkshelf/cookbooks

I noticed that a few of my cookbook directories under .berkshelf were owned by root instead of me. This happens when if you run berks with sudo when installing or updating a cookbook.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top