0
votes

I was trying to fix a strange problem in Rails so I resorted to uninstalling all the gems (using a command found here: http://geekystuff.net/2009/01/14/remove-all-ruby-gems/) and then running bundle install.

The removal was successful, but when I ran bundle install, I got the following error:

Installing activeresource (3.2.13)

Using bundler (1.3.5) Installing rack-ssl (1.3.3)

Installing json (1.8.0)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension .

    c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb creating Makefile

make

generating generator-i386-mingw32.def

compiling generator.c

linking shared-object json/ext/generator.so

make install

/usr/bin/install -c -m 0755 generator.so c:/RailsInstaller/Ruby1.9.3/lib/ruby/ge ms/1.9.1/gems/json-1.8.0/lib/json/ext /usr/bin/install: cannot remove `c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1 /gems/json-1.8.0/lib/json/ext/generator.so': Permission denied make: *** [c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.0/lib/j son/ext/generator.so] Error 1

Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/json-1.8.0 for inspection.

Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8. 0/ext/json/ext/generator/gem_make.out 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've spent a fair amount of time but still can't figure out what's wrong. Please advise.

2
Looks like you're on windows. Problem seems to be with permissions? Are you running as administrator in your command window? - Daiku

2 Answers

0
votes

I downloaded and ran Rails Installer. This time when I ran bundle install, the problem was gone.

0
votes

It might be the white space in your Ruby path:

NOTE: The path to your must not contain any whitespaces (like in “C:\Program Files\Ruby193”). This is very important because whitespaces in the path to your ruby installation will cause certain error messages as soon as you try to install gems which require the DevKit.

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

hth
Frank