n0ne / Rails-Carrierwave-jQuery-File-Upload

Rails 3.2.3 + Carrierwave + jQuery-File-Upload
104 stars 37 forks source link

"Gem::Ext::BuildError: ERROR: Failed to build gem native extension." when running "bundle install" #7

Open ghost opened 9 years ago

ghost commented 9 years ago

Here is output for bundle install command:

evo@famous ~/Downloads/railstest (master) $ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Using rake 0.9.2.2
Using i18n 0.6.0
Using multi_json 1.3.6
Using activesupport 3.2.3
Using builder 3.0.0
Using activemodel 3.2.3
Using erubis 2.7.0
Using journey 1.0.3
Using rack 1.4.1
Using rack-cache 1.2
Using rack-test 0.6.1
Using hike 1.2.1
Using tilt 1.3.3
Using sprockets 2.1.3
Using actionpack 3.2.3
Using mime-types 1.18
Using polyglot 0.3.3
Using treetop 1.4.10
Using mail 2.4.4
Using actionmailer 3.2.3
Using arel 3.0.2
Using tzinfo 0.3.33
Using activerecord 3.2.3
Using activeresource 3.2.3
Using carrierwave 0.6.2
Using coffee-script-source 1.3.3
Using execjs 1.4.0
Using coffee-script 2.2.0
Using rack-ssl 1.3.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/evo/.rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150302-98319-183h689.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:149:9: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (len > 0) {
        ^~~~~~~
./../fbuffer/fbuffer.h:153:12: note: uninitialized use occurs here
    return result;
           ^~~~~~
./../fbuffer/fbuffer.h:149:5: note: remove the 'if' if its condition is always true
    if (len > 0) {
    ^~~~~~~~~~~~~
./../fbuffer/fbuffer.h:146:20: note: initialize the variable 'result' to silence this warning
    FBuffer *result;
                   ^
                    = NULL
./../fbuffer/fbuffer.h:158:47: error: too few arguments provided to function-like macro invocation
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                              ^
/Users/evo/.rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:793:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ (    \
        ^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:158:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' [-Wint-conversion]
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
          ^        ~~~~~~~~~~
2 warnings and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/evo/.gem/ruby/2.2.0/gems/json-1.7.3 for inspection.
Results logged to /Users/evo/.gem/ruby/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/json-1.7.3/gem_make.out
An error occurred while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.
aaronjmccoy commented 6 years ago

First my problem, with similar error message, was due to outdated imagemagick:

brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force
gem install rmagick -v '2.16.0'

Then json produced the same error so I looked into it and saw we need 1.8.2: bundle update json That's when I realized the lockfile was the problem; just delete it and run bundle install. The app is just really outdated, after doing this you'll still need to tweak things around to get it to work.