I have updated xcode to 5.1 and install the command line tools from preference->downloads page.
But when I try to install ruby gems (e.g. sqlite3, nokogiri), it gives errors like this:
*** 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.
And then I checked the mkmf.log:
" -o conftest -I/Users/alun/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/alun/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/alun/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe -Wno-error=unused-command-line-argument-hard-error-in-future conftest.c -L. -L/Users/alun/.rvm/rubies/ruby-2.1.2/lib -lxml2 -arch x86_64 -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
I searched but didn't find similar mkmf.log
It seems the build command doesn't specify gcc or any other things.
Finally I've solved my problem, by reinstall xcode and command line tools, and then reinstall ruby with rvm
Related
When I run sudo gem install cocoapods to update to the latest version, the terminal tells me to check the mkmf.log to check why the extension failed. This is what I get in the mkmf.log:
package configuration for libffi is not found
"xcrun clang -o conftest -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib -L. -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.Internal.sdk/usr/local/lib -arch x86_64 -lruby.2.6 "
In file included from conftest.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: note: did not find header 'config.h' in framework 'ruby' (loaded from '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
Currently trying to install the mysql2 gem on redhat. This is what I'm getting after running gem install
gem install mysql2 -v 0.3.18 -- --with-mysql-config=/usr/bin/mysql_config
checking for ruby/thread.h... *** 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.
It looks like most people who get a similar error need to install mysql dev/lib packages. The packages are already installed and up to date. The mkmf.log file looks like this:
"gcc -o conftest -I/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/x86_64-linux -I/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/backward
-I/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0 -I. -I/home/zdev/.rbenv/versions/2.2.0/include -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3
-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings
-Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -L.
-L/home/zdev/.rbenv/versions/2.2.0/lib -Wl,-R/home/zdev/.rbenv/versions/2.2.0/lib -L/home/zdev/.rbenv/versions/2.2.0/lib -lruby-static -lpthread -lrt
-ldl -lcrypt -lm -lc"
In file included from /home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby.h:33,
from conftest.c:1:
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:107: error: size of array 'ruby_check_sizeof_long' is negative
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:111: error: size of array 'ruby_check_sizeof_voidp' is negative
In file included from /home/zdorman/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby.h:33,
from conftest.c:1:
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_int2num_inline':
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:1303: warning: comparison is always true due to limited range of data type
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:1303: warning: comparison is always true due to limited range of data type
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_uint2num_inline':
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:1313: warning: comparison is always true due to limited range of data type
In file included from /home/zdorman/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/intern.h:35,
from /home/zdorman/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/ruby.h:1710,
from /home/zdorman/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby.h:33,
from conftest.c:1:
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/st.h: At top level:
/home/zdev/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby/st.h:52: error: size of array 'st_check_for_sizeof_st_index_t' is negative
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
The errors in the log file are produced by sanity checks like this:
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
What could be the cause of this issue? gcc and mysql are both 64 bit - are there any other binaries/libs that would cause this issue?
For the record, there is a copy of the mysql2 gem already installed on this system. It was installed a couple years ago by the original developer, and is tied to a ruby install in /usr/bin. I'm trying to migrate a project over to using a ruby managed by rbenv. From a clean ruby install made through rbenv, bundle install will work flawlessly on our ubuntu box, but it trips up with the mysql2 gem on this system.
I had compass working fine with El Capitan, but the compass command was unavailable after upgrading to Sierra, and now I am unable to reinstall compass. Here is the text of the error from mkmf.log:
Applications/MAMP/Library/include/ruby-2.3.0/ruby/backward - I/Applications/MAMP/Library/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -pipe conftest.c -L. -L/Applications/MAMP/Library/lib -L. -fstack-protector -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc "
ld: library not found for -lruby-static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
I have the most current version of XCode installed. I have no idea what is causing this problem.
I resolved this problem by installing Ruby Version Manager:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source /Users/yourusername/.rvm/scripts/rvm
. . . and then reinstalling compass:
sudo gem install compass
My goal is to install the couchbase ruby gem by building the native extensions, but I am having what seems like an architecture mismatch between the gem and the libcouchbase C library. Here is some background:
I am running OS X 10.6.8, using rvm, and ruby 1.9.2-p320 built from source
I was running OS X 10.6.7 and Xcode 3.2.5 up until yesterday but I was unable to build libcouchbase natively
I then installed brew which is known to help ease the libcouchbase install, and brew told me I needed to upgrade to at least Xcode 3.2.6
I downloaded the elusive Xcode 4.2 for Snow Leopard because it was over 2 gigs smaller than
Xcode 3.2.6 and I figured I would get the latest version.
Xcode wouldn't install due to certificate errors which I found were the result of a bug in the System Installer, and the fix was to upgrade to OS X 10.6.8 and then apply a System Update
A few hours and restarts later, I am running OS X 10.6.8 with XCode 4.2 installed and libcouchbase compiles via brew without any hiccups
I now attempt to install the couchbase gem but building native extensions fails. It says it is unable to find libcouchbase even when explicitly passing the location of the library
Inspecting mkmf.log shows the following (bold emphasis added, but I may be wrong about the problem!
"/usr/bin/gcc-4.2 -o conftest -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/universal-darwin10.8.0 -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/Cellar/libevent/2.0.19/include -I/opt/local/include -I/usr/local/include -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include -I/usr/include -I/Users/emkman/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -arch i386 -arch x86_64 -fno-common -pipe -std=c99 -Wall -Wextra conftest.c -L. -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/local/Cellar/libevent/2.0.19/lib -L/opt/local/lib -L/usr/local/lib -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/lib -L/Users/emkman/.rvm/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/lib -arch i386 -arch x86_64 -lruby.1.9.1-static -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
"/usr/bin/gcc-4.2 -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/universal-darwin10.8.0 -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/Cellar/libevent/2.0.19/include -I/opt/local/include -I/usr/local/include -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include -I/usr/include -I/Users/emkman/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -arch i386 -arch x86_64 -fno-common -pipe -std=c99 -Wall -Wextra -arch i386 -arch x86_64 -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <stdarg.h>
4: int foo(int x, ...) {
5: va_list va;
6: va_start(va, x);
7: va_arg(va, int);
8: va_arg(va, char *);
9: va_arg(va, double);
10: return 0;
11: }
12: int main() {
13: return foo(10, "", 3.14);
14: return 0;
15: }
/* end */
have_library: checking for libcouchbase_server_versions() in -lcouchbase... -------------------- no
"/usr/bin/gcc-4.2 -o conftest -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/universal-darwin10.8.0 -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/Cellar/libevent/2.0.19/include -I/opt/local/include -I/usr/local/include -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include -I/usr/include -I/Users/emkman/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -arch i386 -arch x86_64 -fno-common -pipe -std=c99 -Wall -Wextra conftest.c -L. -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/local/Cellar/libevent/2.0.19/lib -L/opt/local/lib -L/usr/local/lib -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/lib -L/Users/emkman/.rvm/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/lib -arch i386 -arch x86_64 -lruby.1.9.1-static -lcouchbase -lpthread -ldl -lobjc "
ld: warning: ignoring file /usr/local/lib/libcouchbase.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_libcouchbase_server_versions", referenced from:
_t in cckhpWpO.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/AT/ATO2AJa-G3Ogm+J4qma1hE+++TI/-Tmp-/mkmf_20120724-40695-16d2a4n/ccAGPue9.out (No such file or directory)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libcouchbase/couchbase.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { void ((*volatile p)()); p = (void ((*)()))libcouchbase_server_versions; return 0; }
/* end */
"/usr/bin/gcc-4.2 -o conftest -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/universal-darwin10.8.0 -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/Cellar/libevent/2.0.19/include -I/opt/local/include -I/usr/local/include -I/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/include -I/usr/include -I/Users/emkman/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -arch i386 -arch x86_64 -fno-common -pipe -std=c99 -Wall -Wextra conftest.c -L. -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/local/Cellar/libevent/2.0.19/lib -L/opt/local/lib -L/usr/local/lib -L/Users/emkman/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/lib -L/Users/emkman/.rvm/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/lib -arch i386 -arch x86_64 -lruby.1.9.1-static -lcouchbase -lpthread -ldl -lobjc "
conftest.c: In function ‘t’:
conftest.c:7: error: too few arguments to function ‘libcouchbase_server_versions’
conftest.c: In function ‘t’:
conftest.c:7: error: too few arguments to function ‘libcouchbase_server_versions’
lipo: can't figure out the architecture type of: /var/folders/AT/ATO2AJa-G3Ogm+J4qma1hE+++TI/-Tmp-/mkmf_20120724-40695-cblicr/ccG9E6Cp.out
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libcouchbase/couchbase.h>
4:
5: /*top*/
6: int main() {return 0;}
7: int t() { libcouchbase_server_versions(); return 0; }
/* end */
So it seems to me that the problem is that gcc is looking for an i386 build of /usr/local/lib/libcouchbase.dylib and inspecting mine shows
/usr/local/lib/libcouchbase.dylib: Mach-O 64-bit dynamically linked shared library x86_64
So now to my question(s). Is this the problem or a red herring? Do I need to be building libcouchbase as i386 or universal, or is the problem on the gem side? I have been building native gem extensions on this system for many years without problem, including the sometimes nasty mysql gem, but now I have new versions of GCC/Xcode. The rvm release notes say that Xcode 4.2 only works with Ruby 1.9.3 and breaks lots of native extensions, so I completely uninstalled it and then installed GCC-10.6.pkg from https://github.com/kennethreitz/osx-gcc-installer/ which rvm recommends as a working, but I still have the same problem. Here is my brew --env dump:
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -Os -w -pipe -march=core2 -msse4.1 -mmacosx-version-min=10.6
CXXFLAGS: -Os -w -pipe -march=core2 -msse4.1 -mmacosx-version-min=10.6
CPPFLAGS: -isystem /usr/local/include
LDFLAGS: -L/usr/local/lib
MACOSX_DEPLOYMENT_TARGET: 10.6
MAKEFLAGS: -j2
Both now and when I had Xcode 4.2 installed, my -march was set to core2. Should this be native instead? I rebuilt ruby 1.9.2-p320 from source, via rvm/JewelryBox after installing my latest osx-gcc toolchain, to ensure it was using the same flags. It is built as universal-darwin and seems correct:
interpreter: "ruby"
version: "1.9.2p320"
date: "2012-04-20"
platform: "universal.x86_64-darwin10.8.0"
patchlevel: "2012-04-20 revision 35421"
full_version: "ruby 1.9.2p320 (2012-04-20 revision 35421) [universal.x86_64-darwin10.8.0]"
I know this is a lot of info, but I just want to be thorough with the details and show that I have tried almost everything. I should also mention that I have tried the developer preview of the gem combined with the developer preview of libcouchbase, and the error is the same. The two things I haven't tried:
Installing XCode 4.1 for Snow Leopard - Apple no longer makes this file available for download even though it is theoretically supported.
Installing Xcode 3.2.6 for Snow Leopard - I was trying to avoid the 4gb download but I have just started it now and can try it later tonight
Any help is greatly appreciated, especially if you have built the couchbase gem on OS X before.
I think this is a good question, as I remember going through some similar pains trying to build the gem myself. However that was a while ago and I don't have the files etc handy to remember what I did or if my errors looked like yours.
I know it's not as good as a direct answer, but I think you should be able to get in touch with the gem author here: https://groups.google.com/forum/#!forum/couchbase or via #avsej on Twitter.
Try the following steps, this resolved the issue for me:
brew unlink libcouchbase
brew install libcouchbase#2
brew link --force --overwrite libcouchbase#2
brew update && brew upgrade
Then try the bundle install or gem install.
bundle install
It appears to be looking for the libmagic.so.1 file. I have that file. It is located in /usr/lib64. I am not running this installation as the root user.
I am also using rvm and Bundler. This is the result of my "bundle" command, when it gets to the ruby-filemagic line in my Gemfile:
[server#mine ext]$ ruby extconf.rb --with-magiclib
checking for magic_open() in -ltrue... no
*** ERROR: missing required library to compile this module
*** 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.
UPDATE:
Here are the results of the mkmf.log:
have_library: checking for magic_open() in -ltrue... -------------------- no
"gcc -o conftest -I. -I/usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/x86_64-linux -I. -g -O2 -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.8.7-p358/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.8.7-p358/lib -L. -rdynamic -Wl,-export-dynamic -lruby-static -ltrue -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:3: error: ‘magic_open’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))magic_open; return 0; }
/* end */
"gcc -o conftest -I. -I/usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/x86_64-linux -I. -g -O2 -fPIC conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.8.7-p358/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.8.7-p358/lib -L. -rdynamic -Wl,-export-dynamic -lruby-static -ltrue -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -ltrue
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { magic_open(); return 0; }
/* end */
I can't figure out what to do to make this work.
Had same problem on Ubuntu 12.04. Just installed libmagic-dev package through following command:
sudo apt-get install libmagic-dev
On a Mac, using homebrew:
sudo brew install libmagic
I needed to do:
yum install file-devel
That apparently contains the libmagic header files that the filemagic ruby gem required in order to compile. It worked like a champ after that.
I had the same problem on OpenSuse 11.3. This helped:
zypper install file-devel