2011-02-02 14 views
9

Ho usato ruby ​​1.9.2 e rails 3.0.3. iam cercando di installare gemma RMagick ma quando ho eseguito bundle install ho ottenuto un errore mi dice:Non riesco a installare rmagick gem su windows

Installing rmagick (2.12.1) with native extensions c:/Ruby192/lib/ruby/site_ruby 
/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR 
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

     c:/Ruby192/bin/ruby.exe extconf.rb 
checking for Ruby version >= 1.8.5... yes 
checking for stdint.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=c:/Ruby192/bin/ruby 
c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to genera 
te an executable file. (RuntimeError) 
You have to install development tools first. 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postp 
one' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' 
     from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header' 
     from extconf.rb:171:in `<main>' 


Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2 
.12.1 for inspection. 
Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.12.1/ext/RMagick 
/gem_make.out 
     from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `b 
lock in build_extensions' 
     from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `e 
ach' 
     from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `b 
uild_extensions' 
     from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `i 
nstall' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/sour 
ce.rb:96:in `install' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst 
aller.rb:55:in `block in run' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec 
_set.rb:12:in `block in each' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec 
_set.rb:12:in `each' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec 
_set.rb:12:in `each' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst 
aller.rb:44:in `run' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst 
aller.rb:8:in `install' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli. 
rb:226:in `install' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend 
or/thor/task.rb:22:in `run' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend 
or/thor/invocation.rb:118:in `invoke_task' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend 
or/thor.rb:246:in `dispatch' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend 
or/thor/base.rb:389:in `start' 
     from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in 
`<top (required)>' 
     from c:/Ruby192/bin/bundle:19:in `load' 
     from c:/Ruby192/bin/bundle:19:in `<main>' 

ho installato rubino da http://rubyinstaller.org/downloads/ con kit di sviluppo e l'ultima versione di ImageMagick. Ho provato a impostare le configurazioni di rmagick (lib e include le directory), ma ho ancora lo stesso errore

aiuto? qualche pensiero per risolvere il problema?

+0

Ecco un video che mostra un tutorial passo-passo su come installare RMagik RubyGem su Windows 7 http://youtu.be/gEWAVlNCKhg [http://youtu.be/gEWAVlNCKhg](http://youtu.be/ gEWAVlNCKhg) – Data

+0

In ritardo alla festa. Dai un'occhiata a questo [risposta] (http://stackoverflow.com/a/39513938/1903781) su come installare 'rmagik' su windows 10. –

risposta

0

Utilizzare rmagick-win32 gem, e non ha bisogno di ImageMagick separatamente. Questo è in bundle.

si prega di dare un'occhiata: http://rmagick.rubyforge.org/install-faq.html#win

+0

intellidiot, non ho trovato questo gioiello: rmagick-win32?!? – Zakwan

+0

AFAIK, questo progetto non viene più mantenuto :(la versione di Windows è ancora più vecchia, ma se vuoi usarli, trova qui http://rubyforge.org/projects/rmagick/ – intellidiot

0

prega di fare riferimento al this thread nel gruppo RubyInstaller che punta al nostro Tutorials page dove è possibile trovare this blog post che descrive il metodo di installazione.

+0

Ho scaricato 6.6.4 Q16 , ma non ha la casella di controllo "Installa le intestazioni di sviluppo" La nuova versione non ne ha neanche 1. – Nakilon

+0

Ecco la schermata: http://img.leprosorium.com/1221636 Quindi dopo l'installazione non vedo alcun * .h lì – Nakilon

+0

Ho già risposto in precedenza su Stackoverflow: http://stackoverflow.com/questions/6473853/ruby-on-rails-rmagick-on-windows-7/6477787#comment-7615667 –

15

Prerequisiti:
Rubino> 1.8.6
DevKit (qualsiasi versione)
Nessun'altra ImageMagick installazione o la messa PATH

Fase 1: Installazione di ImageMagick:

Scarica ImageMagick: http://imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

Installa ImageMagick:
* Imp ortant: il percorso di installazione NON deve contenere spazi.
Idealmente selezionare “C: \ ImageMagick"

Assicurati di selezionare le seguenti opzioni:

Aggiungi directory dell'applicazione per il sistema percorso
Installare header di sviluppo e librerie per C e C++

Fase 2: Installazione RMagick:

Utilizzare il seguente comando per installare gemma RMagick:

gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include 

via-

http://shoobm.wordpress.com/2013/01/03/installing-rmagick-gem-on-windows-7/

+0

I file binari di Windows di ImageMagick possono essere trovati qui: http://www.imagemagick.org/script/binary-releases.php#windows –

1

devo the same problem, il mio ambiente era:

windows XP (x32) 
ruby 1.9.3p484 (2013-11-22) [i386-mingw32] 
DevKit-tdm-32-4.5.2-20111229-1559-sfx 
ImageMagick-6.8.8-2-Q8-x64-static.exe 

installo gemma rmagik con successo, dopo la reinstallazione di ImageMagick da v6. Da 8.8 a 6.6.7. Era solo un problema di versioni di incompatibilità ...

0

Prima di tutto cancellare le variabili di ambiente del percorso. (Questo è il passaggio principale che la gente spesso salta, ma molto importante). Questa è la ragione principale dell'errore che stai affrontando.

quindi installare il programma di installazione rotaie (2.0.0) da qui: http://railsinstaller.org/en

Sarà istituito rubino, rotaie, e tutto ciò che serve. In questo modo verranno configurate anche le variabili del percorso dell'ambiente.

Successivamente installare imagemagick 6.7.9.9 o precedente e durante l'installazione selezionare l'opzione per includere intestazioni C. Assicurati di installarlo nella cartella del programma di installazione dei binari.

Quindi digitare questo nel prompt dei comandi path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path% o qualsiasi altra versione.

quindi digitare

gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"' 

Infine modificare C: \ RailsInstaller \ Ruby2.0.0 \ setup_environment.bat per includere il percorso per ImageMagick

Alla linea 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8; o qualsiasi versione avete

Problemi correlati