fatal error while bundle install (while installing libv8) - ruby-on-rails

I work on windows7 (32-bit) and I get error that while bundle install;
Installing libv8 (3.3.10.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/Ruby192/bin/ruby.exe extconf.rb
*** 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=C:/Ruby192/bin/ruby
Checking for Python... Unable to build libv8: Python not found!
So I can't complete "bundle install".

Install ActivePython version 2.7.2.5, then run:
gem install libv8 --version 3.11.8.0
to install the libv8 in Windows, the latest version 3.11.8.3 can not work in windows, but 3.11.8.0 can in Windows 7.

On windows 7, with ruby193 I installed python27, I added to the PATH variable the python's folder, I wrote gem install libv8 in the console and libv8 was succesfully installed

You need to install python since libv8 seems to depend on Python as you can see in project stats

I opened issue 29 on github and I learned that libv8 is not supported on windows. so there is no solution for the error. Just you can change your platform.

Related

ERROR: Failed to build gem native extension. potracelib.h not found with M1 chip

I'm trying to install a Rails 5 app in my Macbook Air with M1 chip. This app is using a gem called potracer.
After doing $ bundle install I get the error:
Installing potracer 1.1.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/user/.rvm/gems/ruby-2.7.2/gems/potracer-1.1.4/ext/potracer
/Users/user/.rvm/rubies/ruby-2.7.2/bin/ruby -I /Users/user/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20211025-1533-nnxnj9.rb extconf.rb
checking for potracelib.h... no
potracelib.h not found
*** 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
--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=/Users/user/.rvm/rubies/ruby-2.7.2/bin/$(RUBY_BASE_NAME)
--with-potrace-dir
--without-potrace-dir
--with-potrace-include
--without-potrace-include=${potrace-dir}/include
--with-potrace-lib
--without-potrace-lib=${potrace-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/user/.rvm/gems/ruby-2.7.2/extensions/arm64-darwin-20/2.7.0/potracer-1.1.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.7.2/gems/potracer-1.1.4 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.7.2/extensions/arm64-darwin-20/2.7.0/potracer-1.1.4/gem_make.out
An error occurred while installing potracer (1.1.4), and Bundler cannot continue.
Make sure that `gem install potracer -v '1.1.4' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
potracer
I had other issues installing other rails app with the M1 chip but I found workarounds but not in this case.
Ideas on how to solved this?
You have to reinstall potrace loccaly before. The installation seems to be incomplete.
you would need the library/headers installed. Depending on your platform it would be something like libpotrace and libpitrace-dev.
You would install them via homebrew, apt, dnf, etc.
The potrace execution will abort unless you get the potrace.h locally
abort potracelib.h not found' unless find_header('potracelib.h')
require 'mkmf'
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
LIBDIR = RbConfig::CONFIG['libdir']
INCLUDEDIR = RbConfig::CONFIG['includedir']
HEADER_DIRS = ['/opt/local/include', '/usr/local/include', INCLUDEDIR,
'/usr/include']
LIB_DIRS = ['/opt/local/lib', '/usr/local/lib', LIBDIR, '/usr/lib']
dir_config('potrace', HEADER_DIRS, LIB_DIRS)
abort 'potracelib.h not found' unless find_header('potracelib.h')
abort 'lib potrace not found' unless find_library('potrace', 'potrace_version')
create_header
create_makefile('potracer/potracer')
Source: https://github.com/kennyp/potracer/blob/b67d3ff6a1ae672ccc6701fa5245fa532b461ef3/ext/potracer/extconf.rb

Cannot install uchardet gem on Mac OS catalina

Recently I got the following errors when I tried to install the uchardet GEM in MacOS catalina,Even I specific the ICU version and lib, it still doesn't work, anyone have ideas?
Installing uchardet 0.2.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/xxx/.rvm/gems/ruby-2.6.4/gems/uchardet-0.2.0/ext
/Users/xxx/.rvm/rubies/ruby-2.6.4/bin/ruby -I /Users/xxx/.rvm/rubies/ruby-2.6.4/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200420-38494-q9y0cf.rb extconf.rb
Could not find ICU libraries and/or development tools. Try installing "icu-devtools" or "icu" package.
*** 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
--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=/Users/xxx/.rvm/rubies/ruby-2.6.4/bin/$(RUBY_BASE_NAME)
extconf failed, exit code 1
Gem files will remain installed in /Users/xxx/.rvm/gems/ruby-2.6.4/gems/uchardet-0.2.0 for inspection.
Results logged to /Users/xxx/.rvm/gems/ruby-2.6.4/extensions/x86_64-darwin-19/2.6.0/uchardet-0.2.0/gem_make.out
I was able to reproduce this on my mac:
I fixed this error by re-installing and re-linking icu4c
brew install icu4c
brew link icu4c --force # if it shows you an error and tells you to add the path manually add them
restarted my terminal then re-installed the gem (i also tried this)
you will know it's working when you have which icu-config working https://github.com/dmgk/uchardet/blob/506105c5322fe3cde7ce3e2b2868f875b9b57230/ext/extconf.rb#L3-L6
however now i have another error uchardet.c:2:10: fatal error: 'unicode/ucsdet.h' file not found i do think the gems needs better configuration around this

gem install ruby-odbc -v '0.99995' Not able install on ubuntu 11.10

I am not getting error while installing gem ruby-odbc -v'0.99995'.
Please help me to solve this error. I try lot of things but it didn't worked.
Building native extensions. This could take a while...
ERROR: Error installing ruby-odbc:
ERROR: Failed to build gem native extension.
/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
checking for version.h... yes
checking for sql.h... no
*** 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=/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
--with-odbc-dir
--without-odbc-dir
--with-odbc-include
--without-odbc-include=${odbc-dir}/include
--with-odbc-lib
--without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found
I am using ruby 1.8.7 & rails2
Have you tried installing the unix odbc development files?
sudo apt-get install unixodbc-dev
If you're on OS X and having this issue try
brew install unixodbc
Then you should be able to
gem install ruby-odbc

debugger-linecache install error

i try to install the debugger-linecache gem , but i got the following error,
Building native extensions. This could take a while...
....
ERROR: Error installing debugger-linecache:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
*** 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/bin/ruby
extconf.rb:2:in `require': no such file to load -- debugger/ruby_core_source (LoadError)
from extconf.rb:2
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/debugger-linecache-1.1.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/debugger-linecache-1.1.1/ext/trace_nums/gem_make.out
i have already done:
sudo gem install debugger-ruby_core_source
i found the problem to be that since i am on fedora , i am using ruby 1.8.3 and that seems to be problem. now upgraded to ruby 1.9.3, problem solved.
I installed the dependency first:
gem install debugger-linecache --version 1.1.2
After that, I ran the bundle install command and it worked fine.
What dannynjust said, and:
git clone git://github.com/cldwalker/debugger-ruby_core_source.git &&
sudo rm -rf /var/lib/gems/1.8/gems/debugger-ruby_core_source-1.1.7 &&
sudo mv debugger-ruby_core_source /var/lib/gems/1.8/gems/debugger-ruby_core_source-1.1.7

Installing libv8 for ree on Mountain Lion fails

I've been trying to find a solution to this for a few days now and no luck. If anyone has been successful installing the libv8 gem for REE 1.8.7 on ML, could you please let me know the process you followed?
I have both the XCode LLVM compiler as well as the kennethreitz GCC package for 10.7+ v2 installed.
The output when trying to install with native extensions is:
Building native extensions. This could take a while...
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/XXXXX/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
*** 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=/Users/XXXXX/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...
Gem files will remain installed in /Users/XXXXX/.rvm/gems/ree-1.8.7-2012.02/gems/libv8-3.3.10.4 for inspection.
Results logged to /Users/XXXXX/.rvm/gems/ree-1.8.7-2012.02/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
(The results logged are the exact same as the error).
This worked for me.
RUBYOPT=-rrubygems gem install therubyracer
I was able to successfully install the libv8 gem on Mountain Lion on a freshly installed ree-1.8.7. I believe the issue you're seeing stems from the GCC version being used.
As is now described in the osx-gcc-installer's README you should switch from Kenneth Reitz's LLVM-version of GCC to the GCC 4.2 that is available via Homebrew or Macports.
Homebrew instructions:
http://coderwall.com/p/dtbuqg
MacPorts instructions:
http://coderwall.com/p/pagj2w
Note that you will want to set the CC path and establish the necessary symlink as described in those articles.

Resources