ruby - How to install rfuse on ubuntu? -


solved - see below.

i trying install rfuse gem on ubuntu 12.04 vagrant image. in it's extconf, checks fuse , fails.

i have apt-get installed fuse , fuse-utils, , /lib/libfuse.so.2 exists. tried session below, which:

  1. replicates failure
  2. uses nm verify main function exist in library (i don't know if valid.)
  3. try ensure library found using ld_library_path (not sure if valid either)

i'm stuck because i'm not sure how failing. not finding library? if is, not finding right function? looking libraries? other techniques have debug this?

vagrant@n1:~$ ruby2.1 -rmkmf -e 'have_library("fuse")' checking main() in -lfuse... no vagrant@n1:~$ nm -d -c -g /lib/libfuse.so.2 | grep main 0000000000016080 t cuse_lowlevel_main 0000000000016570 t fuse_main 0000000000016840 t fuse_main 0000000000016860 t fuse_main_compat1 0000000000016840 t fuse_main_compat2 0000000000016880 t fuse_main_real 0000000000016890 t fuse_main_real 0000000000016830 t fuse_main_real 0000000000016880 t fuse_main_real_compat22 0000000000016830 t fuse_main_real_compat25 vagrant@n1:~$ env ld_library_path=/lib ruby2.1 -rmkmf -e 'have_library("fuse")' checking main() in -lfuse... no  vagrant@n1:~$ uname -a linux n1 3.2.0-23-generic #36-ubuntu smp tue apr 10 20:39:51 utc 2012 x86_64 x86_64 x86_64 gnu/linux vagrant@n1:~$ file /lib/libfuse.so.2.8.6 /lib/libfuse.so.2.8.6: elf 64-bit lsb shared object, x86-64, version 1 (sysv), dynamically linked, buildid[sha1]=0xdb7e3872302adb18b73703be89224938e5575441, stripped vagrant@n1:~$ file $(which ruby2.1) /usr/bin/ruby2.1: elf 64-bit lsb executable, x86-64, version 1 (sysv), dynamically linked (uses shared libs), gnu/linux 2.6.24, buildid[sha1]=0x9a5173cfb87a0bdb27026d7913fcff5729652848, stripped 

here vagrantfile sets machine testing with:

$script = <<script  sudo apt-get update sudo apt-get install python-software-properties -y sudo apt-add-repository ppa:brightbox/ruby-ng -y sudo apt-get update sudo apt-get install ruby2.1 ruby2.1-dev fuse fuse-utils -y  script  # vagrantfile api/syntax version. don't touch unless know you're doing! vagrantfile_api_version = "2"  vagrant.configure(vagrantfile_api_version) |config|   config.vm.box = "hashicorp/precise64"    config.vm.provision "shell", inline: $script    config.vm.define "n1" |n1|       n1.vm.hostname = "n1"       n1.vm.network "private_network", ip: "172.20.20.10"   end end 

solution

calling have_library (or mkmf code) leaves mkmf.log in working directory. looking @ that, saw following failure:

"gcc -o conftest -i/usr/include/x86_64-linux-gnu/ruby-2.1.0 -i/usr/include/ruby-2.1.0/ruby/backward -i/usr/include/ruby-2.1.0 -i. -d_fortify_source=2   -g -o2 -fstack-protector --param=ssp-buffer-size=4 -wformat -wformat-security -werror=format-security -fpic conftest.c  -l. -l/usr/lib/x86_64-linux-gnu -l. -wl,-bsymbolic-functions -wl,-z,relro -l/build/buildd/ruby2.1-2.1.2/debian/lib -fstack-protector -rdynamic -wl,-export-dynamic     -lruby-2.1 -lfuse  -lpthread -lrt -lgmp -ldl -lcrypt -lm   -lc" /usr/bin/ld: cannot find -lfuse collect2: ld returned 1 exit status checked program was: /* begin */  1: #include "ruby.h"  2:  3: /*top*/  4: extern int t(void);  5: int main(int argc, char **argv)  6: {  7:   if (argc > 1000000) {  8:     printf("%p", &t);  9:   } 10: 11:   return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; } /* end */ 

i tried ld -lfuse --verbose , able more details on failure, including looking library:

attempt open /lib/libfuse.so failed attempt open /lib/libfuse.a failed 

neither of exist! don't know why not, tried symlinking sudo ln -s /lib/libfuse.so.2 /lib/libfuse.so , ld worked.

continuing gem install, missing 2 libraries: sudo apt-get install -y libfuse-dev make. additions, able install , use gem.

your mkmf call should generate mkmf.log in current directory. in should particulars of how calls gcc, , didn't work. can extract commands , continue drill down.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -