I'm trying to install Rails on my Mac (Yosemite). I've gone through several SO questions, reinstalling libxml2 with Homebrew, and with RVM, and updating Ruby, etc. and nothing has worked so far. My libxml2 version is 2.9.2.
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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.
What should I try next?
You have issues with nokogiri building.
Try the following steps. This should work for Yosemite:
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
Related
Everytime I try to install bundle I receive this error and I dont know what to do, I just update rails to 3.2.0. Im already on Ubuntu and my sqlite3 version is 3.37.2
I have tryed to uninstall sqlite3 and gem sqlite3-rails and then reinstall them, but nothing has change.
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ext/sqlite3
/home/computer/.rbenv/versions/3.2.0/bin/ruby -I /home/computer/.rbenv/versions/3.2.0/lib/ruby/3.2.0 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3400000.tar.gz into tmp/x86_64-linux-gnu/ports/sqlite3/3.40.0... OK
Running 'configure' for sqlite3 3.40.0... OK
Running 'compile' for sqlite3 3.40.0... OK
Running 'install' for sqlite3 3.40.0... OK
Activating sqlite3 3.40.0 (from /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ports/x86_64-linux-gnu/sqlite3/3.40.0)...
Could not configure the build properly (pkg_config). Please install either the `pkg-config` utility or the `pkg-config` rubygem.
*** 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.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/sqlite3-1.5.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4 for inspection.
Results logged to /home/computer/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/sqlite3-1.5.4/gem_make.out```
I solved it installing pkg-config and then bundle install worked correctly
sudo apt-get update -y
sudo apt-get install -y pkg-config
bundle isntall
I 'm using new MACBook PRO (chip: Apple M2) and trying to set up rails application but therubyracer gem is not installing. I tried below steps but didn't work
brew install v8#3.15
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/opt/homebrew/opt/v8#3.15
when i tried with 'brew install v8#3.15' it gives below error
Warning: v8#3.15 has been deprecated because it depends on Python 2 to build!
Error: v8#3.15: no bottle available!
If you're feeling brave, you can try to install from source with:
brew install --build-from-source v8#3.15
It is expected behaviour that most formulae will fail to build from source.
It is expected behaviour that Homebrew will be buggy and slow when building from source.
Do not create any issues about failures building from source on Homebrew's GitHub repositories.
Do not create any issues building from source even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help building from source from MacHomebrew on Twitter.
You may ask for help building from source in Homebrew's discussions but are unlikely to receive a response.
If building from source fails, try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
eve after installing v8 as suggested with command 'brew install --build-from-source v8#3.15', therubyracer gem is still not installing,
thrrubyracer error log:
Building native extensions with: '--with-v8-dir=/opt/homebrew/opt/v8#3.15'
This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/rashmib/.rvm/gems/ruby-2.7.0/gems/therubyracer-0.12.3/ext/v8
/Users/rashmib/.rvm/rubies/ruby-2.7.0/bin/ruby -I /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0 -r ./siteconf20221117-7943-1tz6m31.rb extconf.rb --with-v8-dir\=/opt/homebrew/opt/v8#3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.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:
...
/Users/rashmib/.rvm/gems/ruby-2.7.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Users/rashmib/.rvm/gems/ruby-2.7.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/rashmib/.rvm/gems/ruby-2.7.0/extensions/-darwin-21/2.7.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Any idea how can i resolve this?
I am using Ruby 1.9.3 and therefore have to use an older version of Nokogiri. I need to install Nokogiri v1.5.10.
Initially I got an error that libxml2 is missing. After installing libxml2 I got the following error:
ERROR: Error installing nokogiri-1.5.10.gem:
ERROR: Failed to build gem native extension.
/opt/ruby-1.9.3/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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.
Do I need to install each and every dependency manually?
If so, how do i determine what version to use?
NOTE: The server does not have access to the internet. Therefore, I have to scp rpm or tar files to install.
Unfortunately yes, you will need to install each dependency manually with that version of Nokogiri as I don't believe they packaged the dependencies in until version 1.6.0.rc1.
Why is it so hard to get Ruby on Rails to work on a Mac? On Windows it is so easy but on my Mac, which I am now forced to use, it just doesn't want to play ball!
I cd into the project directory and run:
rails server
The the Terminal says:
You have requested:
sqlite3 >= 0
The bundle currently has sqlite3 locked at 1.3.10.
Try running `bundle update sqlite3`
Run `bundle install` to install missing gems.
So I run bundle update sqlite3 but then get:
*** 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.
...
An error occurred while installing debugger (1.6.8), and Bundler cannot
continue.
Make sure that `gem install debugger -v '1.6.8'` succeeds before bundling.
I then run gem install debugger -v '1.6.8'
Building native extensions. This could take a while...
ERROR: Error installing debugger:
ERROR: Failed to build gem native extension.
/Users/me/.rbenv/versions/2.1.5/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.
You didn't share the logs, but I suggest you to check/install Xcode command line tools, which you can do with:
xcode-select --install
Or by opening Xcode and installing them using GUI.
I am trying to install the qrencoder gem on my mac osx 10.7.4 to use in a ruby on rails project.
When I try gem install qrencoder here is what I get:
ERROR: Error installing qrencoder:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for qrencode.h... yes
checking for QRinput_new() in -lqrencode... 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.
The mkmf.log file does not say anything other than the above.
I have qrencode-3.3.0 installed ok with brew but the gem install fails: any idea ?
when I type qrencode, here is what I get:
"dyld: Library not loaded: /usr/local/lib/libqrencode.3.dylib
Referenced from: /usr/local/bin/qrencode
Reason: Incompatible library version: qrencode requires version 7.0.0 or later, but libqrencode.3.dylib provides version 5.0.0
Trace/BPT trap: 5"
First install libqrencode via homebrew:
brew install qrencode
Then try installing the gem again:
gem install qrencoder
There are more detailed instructions at https://github.com/harrisj/qrencoder if you don't have homebrew and/or would prefer to compile from source.
To install qrencode on ubuntu 12.04 run the command:--
sudo apt-get install qrencode libqrencode-dev