3

When I try to do a bundle install I get the following json error. The bundle install does not complete. What gives?

Errno::EACCES: Permission denied - /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/.gitignore
An error occurred while installing json (1.7.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.5'` succeeds before bundling.

>>$ gem install json -v '1.7.5'
ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/.gitignore

EDIT: The sudo install command gives the following error:

>>$ sudo gem install json -v '1.7.5' 
Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

    /usr/local/Cellar/ruby/1.9.3-p194/bin/ruby extconf.rb
creating Makefile

make
sh: make: command not found


Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
Nick5a1
  • 917
  • 3
  • 15
  • 28
  • 1
    Found the answer here: http://stackoverflow.com/questions/6550495/sh-make-command-not-found-when-running-bundle-after-adding-redcarpet-gem Needed to upgrade command line tools after installing Mountain Lion – Nick5a1 Sep 05 '12 at 20:16

3 Answers3

4

you need to install ruby1.8-dev and not just ruby1.8, you are missing the development headers.

if on OSX:

sudo install ruby1.8-dev

if on unix

sudo aptitude install ruby1.8-dev

or

sudo apt-get install ruby1.8-dev

go into your directory with rubygems source and run: sudo ruby setup.rb after that run:

if on OSX:

sudo gem install json -v '1.7.5'

some unix system may need gem version command to work properly so you should run:

sudo gem1.8 install json -v '1.7.5'
  • 1
    Please re-edit your answer and remove text speak! This is an international english forum and you have a keyboard in front of you, use it! -1 for clearly lazy usage of english which may not be native to other non-english speaking people! – t0mm13b Dec 24 '12 at 21:12
  • Better :) Happy holidays! :) \o/ – t0mm13b Dec 24 '12 at 21:26
1

Try using this script

sudo chown -R $USER /usr/local

Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
1

Found the answer here: "sh: make: command not found" when running "$ bundle" after adding redcarpet gem to Rails app Needed to upgrade command line tools after installing Mountain Lion

Community
  • 1
  • 1
Nick5a1
  • 917
  • 3
  • 15
  • 28