I'm trying to build LinkParser in Ruby.
I have RVM Ruby 1.9.2, initially the installer failed to build LinkParser because link-grammar wasn't present, but once I installed it with sudo port install link-grammar, the build error changed to this:
checking for pkg-config... yes
MacOS X build: fixing architecture flags:
using the value in ARCHFLAGS environment variable ("-arch x86_64").
checking for dictionary_create() in -llink-grammar... yes
checking for link-grammar/link-includes.h... no
*** extconf.rb failed ***
It says the link-includes.h file is missing. Are there any other packages I'm missing that need to be present in order to get this installed?
the macports version is too old, It requires at least version 4.7.0 of link-grammar, so I just compiled it from source and it worked.
Related
I found this "Zlib missing" continously when installing gems for Rails on Ruby, please let me know a solution :
Fetching nokogiri 1.10.2
Installing nokogiri 1.10.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.2/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190407-34092-u44l37.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for iconv.h... yes
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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.
I also re-installed OSX 10.14 SDK header but didn't work.
It turned out that I have to manually download zlib from its site and then install it myself to make it work.
Extract the package then install as instruction :
./Configure
make
make install
I uninstall version 0.18.1 and now I cannot install any of the versions.
I would like to install 0.18.2
I am running this command:
gem install pg -v '0.18.2'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/liviu-mac/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150901-1693-1wdi2b8.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.
Don't know how to fix the installation?
I used a wrong path, the correct command in my case is:
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
I used 9.3 instead of 9.4
I have installed libcouchbase using homebrew and also building from source following these instructions http://docs.couchbase.com/couchbase-sdk-c-2.4/ but still get the error
Building native extensions. This could take a while...
ERROR: Error installing couchbase:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for lcb_iops_wire_bsd_impl2(NULL, 0) in -lcouchbase... no
**********************************************************************
* You must install libcouchbase >= 2.4.0
* See http://www.couchbase.com/communities/c/ for more details
**********************************************************************
*** 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.
I'm using ruby 2.0
Judging by the error message, it would appear you need the latest version of libcouchbase. Ensure you do a brew update first so that brew is aware of the latest version.
mnunberg#mbp15 ~ $ cbc version
cbc:
Runtime: Version=2.4.6, Changeset=803c3c79cd72455aa62ab39eaf7a597e5d6de7e5
Headers: Version=2.4.6, Changeset=803c3c79cd72455aa62ab39eaf7a597e5d6de7e5
IO: Default=libevent, Current=libevent
SSL: .. SUPPORTED
I am installing gem sqlite3 for rails 4 and get a compilation error. This is a completely new macbook pro with Mavericks OS installed. I have installed XCode, but then also installed gcc 4.9 using Homebrew (using instructions here). Everything was going smooth until I started getting a compilation error while trying to install the gem sqlite3:
app_folder git:(mybranch) gem install sqlite3 -v '1.3.8'
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/myname/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
make "DESTDIR="
compiling backup.c
gcc-4.9: error: unrecognized command line option '-Wshorten-64-to-32'
make: *** [backup.o] Error 1
Upon doing some research of the issue, I have found little information besides that this command line option is mac-specific and Homebrew-installed gcc compiler does not have it! Is there a way for me to switch back to native mac gcc compiler? How do I resolve this and why is it barely mentioned anywhere?
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx- include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.1
I just installed Rails and had a similar experience. I fixed it by getting osx to recognize the correct g++ version and then reinstalling ruby. Here are a few suggestions:
You can set your gcc and g++ version via .bash_profile with the following code
export CC=gcc-4.9
export CXX=g++-4.9
export CPP=cpp-4.9
check your g++ version with g++ -v. If this doesn't work you may need to do bit of hacking.
Per http://instantbadger.blogspot.com/2011/11/porting-rails-23-app-to-ruby-19.html, you can remove the default g++ in /usr/bin and substitute it with a new symlink to g++-4.9:
sudo mv /usr/bin/g++ /usr/bin/g++.bak && sudo ln -s /usr/local/bin/g++-4.9 /usr/bin/g++
Note: this command is different from the one present in the linked page (which moves /usr/local/bin/g++). I didn't have a copy of g++ in /usr/local/bin/, so I adapted the command to work with /usr/bin instead.
Check g++ -v again. It should now reflect the correct version of g++.
Once your g++ version checks out, you can try reinstalling ruby. This insures that your ruby version is compiled with the same compiler that your going to build your gems with.
rvm install 2.0.0
Once you've done that, repeat
gem install sqlite3 -v '1.3.8'
Hopefully, this should work now.
I've installed the newer version of SQLite3 (3.7.0.1) on my macbook (OS X 10.5) but 'sqlite3 --version' gives me the older version I had on my system:
$ sqlite3 --version
3.4.0
I suppose I was expecting this version to be overwritten but that doesn't seem to be the case. Can anyone clue me in? I'd really appreciate it, right now I'm trying to get started with Rails but I had received this error:
$ sudo gem install sqlite3-ruby
Password:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for #include <sqlite3.h>
... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!
*** 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.
Oddly enough though since installing the new version of sqlite3 this error has gone away (in other words sqlite3-ruby was installed successfully) - but sqlite3 still points to 3.4.0, I've checked the directories in my $PATH and they only contain 3.7.0.1
Thanks in advance for any help.
Have you tried telling the OS to use the new one by typing hash sqlite3? Sometimes an OS remembers the original version and doesn't know to refresh itself and hash will poke it in the eye.
Otherwise you might need to tell the gem to look in the right place. Check into these options in the installer:
--with-sqlite3-dir
--with-sqlite3-include
--with-sqlite3-lib
I also face the same problem on my CentOS Server. I found this solution work for me. Hope it help! http://amitava1.blogspot.com/2010/08/ruby-on-rails-on-centos-55-with.html
main process:
$ wget http://www.sqlite.org/sqlite-amalgamation-3.7.0.1.tar.gz
$ tar xvzf sqlite-amalgamation-3.7.0.1.tar.gz
$ cd sqlite-3.7.0.1
$ ./configure --prefix=/opt/local/sqlite-3.7.0.1
$ make
$ sudo make install
$ sudo /opt/ruby-enterprise-1.8.7-2010.02/bin/gem install sqlite3-ruby -- --with-sqlite3-dir=/opt/local/sqlite-3.7.0.1
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.3.1
1 gem installed