2010-03-25 8 views
1

Comment réparer cette erreur et installer des gemmes fines ou autres?Impossible d'installer thin en utilisant des rubygems sur Ubuntu 9.10

 
$ sudo gem install thin 
Building native extensions. This could take a while... 
ERROR: Error installing thin: 
    ERROR: Failed to build gem native extension. 

/usr/bin/ruby1.9.1 extconf.rb 
checking for rb_trap_immediate in ruby.h,rubysig.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. 

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.9.1 
/usr/lib/ruby/1.9.1/mkmf.rb:362:in `try_do': The complier failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /usr/lib/ruby/1.9.1/mkmf.rb:425:in `try_compile' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:543:in `try_var' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:791:in `block in have_var' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:668:in `block in checking_for' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:274:in `block (2 levels) in postpone' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:248:in `open' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:274:in `block in postpone' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:248:in `open' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:270:in `postpone' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:667:in `checking_for' 
    from /usr/lib/ruby/1.9.1/mkmf.rb:790:in `have_var' 
    from extconf.rb:16:in `' 


Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-0.12.10 for inspection. 
Results logged to /var/lib/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out 

supplémentaire.ora Infomation comme ci-dessous

 
$ cat /etc/issue 
Ubuntu 9.10 \n \l 
$ dpkg -l | grep ruby 
ii libreadline-ruby1.9.1    1.9.1.243-2     Readline interface for Ruby 1.9.1 
ii libruby1.9.1      1.9.1.243-2     Libraries necessary to run Ruby 1.9.1 
ii ruby1.9.1       1.9.1.243-2     Interpreter of object-oriented scripting lan 
ii ruby1.9.1-dev      1.9.1.243-2     Header files for compiling extension modules 
ii rubygems1.9.1      1.3.5-1ubuntu2    package management framework for Ruby librar 
$ ruby -v 
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux] 
$ gem list 

*** LOCAL GEMS *** 

rack (1.1.0) 
sinatra (1.0) 

Répondre

2

j'avais:

ERROR: Error installing thin: 
    ERROR: Failed to build gem native extension. 

/usr/bin/ruby1.8 extconf.rb 
checking for rb_trap_immediate in ruby.h,rubysig.h... yes 
checking for rb_thread_blocking_region()... no 
checking for inotify_init() in sys/inotify.h... yes 
checking for writev() in sys/uio.h... yes 
checking for rb_thread_check_ints()... no 
checking for rb_time_new()... yes 
checking for sys/event.h... no 
checking for epoll_create() in sys/epoll.h... yes 
checking for main() in -lcrypto... no 
creating Makefile 

make 
g++ -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_EPOLL_CREATE -DHAVE_EPOLL -DWITHOUT_SSL -I/include/include -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c emwin.cpp 
make: g++: Command not found 
make: *** [emwin.o] Error 127 

il a mentionné que g ++ était absent, donc je l'ai fait:

sudo apt-get install g++ 

puis couru:

sudo gem install thin 

et il a travaillé

aussi, je ne suis pas sûr si elle peut avoir rien à voir avec cette installation, mais comme il est un parfois précaution, installer 64 bits, j'installer les 32 libs:

sudo apt-get install ia32libs 

mais j'Installez toujours le 32libs dès que je installer un nouveau serveur 64 bits

+2

recherche pour l'équivalent de cette réponse pour OS X ... – jm3

+0

même ici. Sous Mac OS 10.9, Ruby 2.0.0-p247 – slant

Questions connexes