Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AhmedNadar opened this issue Jun 18, 2016 · 5 comments
Open

Comments

@AhmedNadar
Copy link

I'm trying to install Rails 4.2.6. My ruby version is ruby 2.4.0dev (2016-06-18) [x86_64-darwin15]
I get the following error every time i run bundle install

Building native extensions.  This could take a while...
Installing yajl-ruby 1.2.1 with native extensions

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

    current directory: /Users/ahmed/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
/Users/ahmed/.rbenv/versions/2.3.0-dev/bin/ruby -r ./siteconf20160618-95324-tgmf65.rb extconf.rb
creating Makefile

current directory: /Users/ahmed/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR=" clean

current directory: /Users/ahmed/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c:881:22: error: use of undeclared identifier 'rb_cFixnum'
    rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
                     ^
1 error generated.
make: *** [yajl_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/ahmed/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to /Users/ahmed/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-15/2.4.0-static/yajl-ruby-1.2.1/gem_make.out

Any solution?

@denisdefreyne
Copy link

I believe you’re looking for #165.

@imkaywu
Copy link

imkaywu commented May 17, 2017

So how to fix this issue exactly? sorry in advance if this is a dumb question, I'm really new to ruby.

@zegomesjf
Copy link

@imkaywu you should use
ruby < 2.4 with yajl-ruby 1.2.1 or
use Ruby >= 2.4 with the latest version of yajl-ruby >= 1.3

@imkaywu
Copy link

imkaywu commented May 22, 2017

I did the same the thing as your first suggestion, and it worked. thanks

albertoleal pushed a commit to pivotal-cf/rabbit-labrat that referenced this issue Jun 15, 2017
* Previous version was not supported on ruby 2.4.0
brianmario/yajl-ruby#164

[#146915863]

Signed-off-by: Alberto Leal <aleal@pivotal.io>
zetter added a commit to computationclub/computationclub.github.io that referenced this issue Aug 23, 2017
I had trouble running this on a newer version of ruby (2.4.1)
because the version of `yajl-ruby` isn't compatible.
I thought it's best to update all gems to to fix this problem
and keep up to date with what github pages is using.

[1] brianmario/yajl-ruby#164
@hshivam00
Copy link

hshivam00 commented Jun 25, 2019

Thank you for the update, but I'm still facing the same issue:

**C:\Ubuntu_1804_OnWindows_WSL\wpscanteam-wpscan-2.9.1-58-g89c0b8d\wpscanteam-wpscan-89c0b8d>gem install yajl-ruby -v '1.4.1' --source 'https://rubygems.org/'
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing yajl-ruby:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl

C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190625-14176-q8gsld.rb extconf.rb
creating Makefile

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl
make "DESTDIR=" clean
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl
make "DESTDIR="
make failedNo such file or directory - make "DESTDIR="

Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/yajl-ruby-1.4.1/gem_make.out

C:\Ubuntu_1804_OnWindows_WSL\wpscanteam-wpscan-2.9.1-58-g89c0b8d\wpscanteam-wpscan-89c0b8d>gem install yajl-ruby >= 1.3 --source 'https://rubygems.org/'
ERROR: Error installing yajl-ruby:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl

C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190625-7436-wcaipg.rb extconf.rb
creating Makefile

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl
make "DESTDIR=" clean
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1/ext/yajl
make "DESTDIR="
make failedNo such file or directory - make "DESTDIR="

Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.4.1 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/yajl-ruby-1.4.1/gem_make.out**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants