簡體   English   中英

Rails-無法在Windows 8.1上安裝rmagick for Paperclip

[英]Rails - Can't Install rmagick for Paperclip on Windows 8.1

我在Rails 4.1應用程序中需要paperclip 但是我無法在Windows 8.1中安裝rmagick gem

我的機器已經安裝了DevKitImageMagick 6.8.9 然后,我嘗試使用以下命令安裝rmagick gem:

gem install rmagick --platform=ruby -- --with-opt-dir=C:/ImageMagick-6.8.9-Q16

它顯示“ 無法構建本地gem擴展 ”,並要求我檢查mkmf.log以獲得詳細信息。 這是日志:

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -IC:/ImageMagick-6.8.9-Q16/include -DFD_SETSIZE=2048  -DFD_SETSIZE=2048  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -LC:/ImageMagick-6.8.9-Q16/lib -L.    -lCORE_RL_magick_ -lX11  -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lX11
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

嘗試搜索該錯誤,但未找到任何內容。

注意事項

這是我收到的第一個完整錯誤消息:

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:/Ruby193/bin/ruby
C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postp
one'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
        from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
        from extconf.rb:194:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/rmagick-2
.13.2 for inspection.

您不需要rmagick gem即可運行Paperclip。 您只需要在系統上安裝ImageMagick。 從您的Gemfile中刪除rmagick。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM