From: "Douglas A. Seifert" Date: 2008-07-19T11:02:38+09:00 Subject: Re: compile from source - how difficult? Tom Cloyd wrote: > Martin DeMello wrote: >> On Fri, Jul 18, 2008 at 3:34 PM, Tom Cloyd wrote: >>> On a fresh install of Kubuntu Linux (ver. 8.04.01), I'm not having >>> good day >>> trying to get ruby and rubygems back and functional. >> >> I got webby installed under Ubuntu 8.04 without having to compile >> anything from source. I did face some other issues, though - see >> http://markmail.org/message/apqjib2ftfr5dukk >> >> Since your immediate problem appears to be pthreads-related, see if >> you have the following installed: >> >> libpthread-stubs0 >> libpthread-stubs0-dev >> >> martin >> >> > > Here's what's installed, apparently - > > $ locate libpthread > /lib/libpthread-2.7.so > /lib/libpthread.so.0 > /lib/tls/i686/cmov/libpthread-2.7.so > /lib/tls/i686/cmov/libpthread.so.0 > > So, I went to Adept and found the two things (packages? modules? I > haven't a clue) an installed them. > > Then... > > $ sudo gem install webby > [sudo] password for tomc: > Building native extensions. This could take a while... > ERROR: Error installing webby: > ERROR: Failed to build gem native extension. > > /usr/bin/ruby1.8 extconf.rb install webby > checking for main() in -lpthread... 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=/usr/bin/ruby1.8 > --with-pthreadlib > --without-pthreadlib > > > Gem files will remain installed in > /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0 for inspection. > Results logged to > /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/ext/gem_make.out > > > This was what was happening before. > > Checking the mkmf.log file mentioned above, I find: > > have_library: checking for main() in -lpthread... -------------------- no > > "cc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I. > -fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L"." -L"/usr/lib" > -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic > -lruby1.8-static -lpthread -lpthread -ldl -lcrypt -lm -lc" > /usr/bin/ld: crt1.o: No such file: No such file or directory > collect2: ld returned 1 exit status > checked program was: > /* begin */ > 1: /*top*/ > 2: int main() { return 0; } > 3: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; } > /* end */ > > "cc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I. > -fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L"." -L"/usr/lib" > -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic > -lruby1.8-static -lpthread -lpthread -ldl -lcrypt -lm -lc" > /usr/bin/ld: crt1.o: No such file: No such file or directory > collect2: ld returned 1 exit status > checked program was: > /* begin */ > 1: /*top*/ > 2: int main() { return 0; } > 3: int t() { main(); return 0; } > /* end */ > > -------------------- > > Then, checking > /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/ext/gem_make.out > (mentioned in the webby install effort console output, above), I find > simply a repetition of the error output printed to the console as a > result of the webby install attempt. > > Sadly, I cannot make sense of any of this, so I'm very open to > suggestions at this point. > > Thanks! > > t. On ubuntu, to compile anything, you should install the build-essential package: $ sudo apt-get install build-essential You may also have to install the ruby1.8-dev package as well: $ sudo apt-get install ruby1.8-dev Good luck. When compiling gems, you usually will need dev version of any library that the gem has a dependency on. -Doug Seifert