rowland / fb

Firebird Extension Library for Ruby
64 stars 35 forks source link

Failed to build gem native extension on El Capitan #46

Closed glennfu closed 8 years ago

glennfu commented 8 years ago

I tried with both Ruby 2.2.4 and 2.3.0, to install this gem. Here's the output I get:

/Users/Glenn/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160307-31590-1kd5a3y.rb extconf.rb
checking for isc_attach_database() in -lfbclient... *** 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/Glenn/.rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
    --with-firebird-dir
    --without-firebird-dir
    --with-firebird-include
    --without-firebird-include=${firebird-dir}/include
    --with-firebird-lib
    --without-firebird-lib=${firebird-dir}/lib
    --with-fbclientlib
    --without-fbclientlib
/Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
    from /Users/Glenn/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
    from extconf.rb:71:in `block in <main>'
    from extconf.rb:71:in `each'
    from extconf.rb:71:in `find'
    from extconf.rb:71:in `<main>'

extconf failed, exit code 1

Before this I followed the instructions here: http://www.firebirdsql.org/file/documentation/papers_presentations/html/paper-fb-macosx-install.html

Which led me to download the latest Mac version here: https://sourceforge.net/projects/firebird/files/

Are there other instructions I need to follow in order to get this installed? Please advise, thank you!

glennfu commented 8 years ago

Looks like I'd found the wrong installer. Going here:

http://www.firebirdsql.org/en/firebird-2-5/#MacOSX the "FirebirdCS-2.5.5-26952-x86_64.pkg" installed properly for me and then I was able to install the fb gem. All good!

athariel commented 8 years ago

@glennfu I'm getting exactly the same error on El Capitan. I have already spent almost a whole day on it with no success. Can you please write how did you install fb gem after running the FirebirdCS-2.5.5-26952-x86_64.pkg installer? Did just "gem install fb" work? Which version of fb gem did you install?

I am running ruby 2.2.4

glennfu commented 8 years ago

@athariel Using Ruby 2.3.0 here, but once I installed that Firebird version, "bundle install" worked, where my Gemfile contains "activerecord-fb-adapter". So that should be enough. Maybe add a reboot to the mix?

I also found when I wanted to host a server, I needed to download "FirebirdSS-2.5.5-26952-x86_64.pkg" or the latest "Mac OS X 64-bit Superserver (Intel)" file, and install that.

From there I added to my ~/.bash_profile:

export FIREBIRD_HOME=/Library/Frameworks/Firebird.framework/Resources
export PATH="$PATH:$FIREBIRD_HOME/bin"

I hope that helps!

athariel commented 8 years ago

@glennfu Thanks a lot! You saved my day! I don't know what helped, but what I did was:

  1. add FIREBIRD_HOME and PATH in .bash_profile as @glennfu suggested
  2. run bundle install which this time ended with ld: framework not found Firebird error as described here: #22
  3. run xcode-select --install as sugested in #22 (after this I still got the error)
  4. reboot my mac
  5. bundle install success!

Maybe it will help someone else.

glennfu commented 8 years ago

Yay!

a0s commented 4 years ago

For those of yours who will face this problem: 1) For me, it started working only after cloning locally and gem 'fb', path: '../fb' 2) I suppose that problem is here, Imho it heeds absolute path to Firebird