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 install bigdecimal is failing #7663

Closed
imdmahajankanika opened this issue May 15, 2024 · 3 comments
Closed

gem install bigdecimal is failing #7663

imdmahajankanika opened this issue May 15, 2024 · 3 comments
Labels

Comments

@imdmahajankanika
Copy link

Hello,

WithRuby version 3.2.4-p170 (2024-04-23) [x86_64-linux]and Rails version 6.1.7.7, gem install bigdecimal is failing with below error.

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

    current directory: /usr/local/bundle/gems/bigdecimal-3.1.8/ext/bigdecimal
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 extconf.rb
checking for __builtin_clz()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
/usr/local/lib/ruby/3.1.0/mkmf.rb:490:in `try_do': The compiler failed to
generate an executable file. (RuntimeError)
You have to install development tools first.
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:616:in `block in try_compile'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:565:in `with_werror'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:616:in `try_compile'
	from extconf.rb:6:in `block in have_builtin_func'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:989:in `block in checking_for'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:354:in `block (2 levels) in postpone'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:324:in `open'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:354:in `block in postpone'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:324:in `open'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:350:in `postpone'
	from /usr/local/lib/ruby/3.1.0/mkmf.rb:988:in `checking_for'
	from extconf.rb:5:in `have_builtin_func'
	from extconf.rb:18:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /usr/local/bundle/extensions/x86_64-linux/3.1.0/bigdecimal-3.1.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/bundle/gems/bigdecimal-3.1.8 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/3.1.0/bigdecimal-3.1.8/gem_make.out

  /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in `run'
  /usr/local/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:in `build'
  /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in `build_extension'
/usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in `block in
build_extensions'
  /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `each'
  /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `build_extensions'
  /usr/local/lib/ruby/3.1.0/rubygems/installer.rb:843:in `build_extensions'
/usr/local/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:72:in
`build_extensions'
  /usr/local/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in `install'
  /usr/local/lib/ruby/3.1.0/bundler/source/rubygems.rb:207:in `install'
  /usr/local/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in `install'
/usr/local/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/usr/local/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/usr/local/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
  /usr/local/lib/ruby/3.1.0/bundler/worker.rb:62:in `apply_func'
  /usr/local/lib/ruby/3.1.0/bundler/worker.rb:57:in `block in process_queue'
  /usr/local/lib/ruby/3.1.0/bundler/worker.rb:54:in `loop'
  /usr/local/lib/ruby/3.1.0/bundler/worker.rb:54:in `process_queue'
/usr/local/lib/ruby/3.1.0/bundler/worker.rb:91:in `block (2 levels) in
create_threads'

An error occurred while installing bigdecimal (3.1.8), and Bundler cannot
continue.

@deivid-rodriguez
Copy link
Member

You need to install a compiler, gcc should do the trick. How to install that depends on your OS.

@imdmahajankanika
Copy link
Author

You need to install a compiler, gcc should do the trick. How to install that depends on your OS.

@deivid-rodriguez it worked with the installation of build-essentials

@deivid-rodriguez
Copy link
Member

Alright, glad you figured it out!

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

No branches or pull requests

2 participants