在Windows上怎么安装 rmagick这个gem?

BluesChow 发布于 2015/04/28 21:33
阅读 1K+
收藏 0

Linux基金会免费官方培训及考试申请即将截止,戳这里申请!>>>

@玛雅牛 你好,想跟你请教个问题:我想在windows上部署一个rails开发的网站,按照你的文章:http://my.oschina.net/myaniu/blog/140777 基本的已经没问题了,但是我的网站里面需要用到rmagick这个gem,我怎么都安装不上,请问这个gem该怎么安装啊?谢谢

我参考了:

http://lukefan.com/?p=620

http://www.iteye.com/problems/12273

加载中
0
玛雅牛
玛雅牛

没有在windows下搞过这个。rails是符合unix哲学的开发框架,建议在linux/mac下开发。会省很多劲。

BluesChow
BluesChow
是因为需要部署到windows的服务器上,这点没法变啊,谢谢!
0
sevk
sevk
gem install rmagick 什么提示?发来看看,虽然不是很懂
BluesChow
BluesChow
请帮看下我回答里面的贴出的错误代码,非常感谢!
0
BluesChow
BluesChow

前提:DevKit已经安装好了,按照Ruby-China上的WIKI已经配置了CPATH和LIBRARY_PATH了。

错误代码如下:

C:\Users\Administrator>gem install rmagick -- --with-opt-dir=D:\Dev\openssl-1.0.
0k-x86-windows
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir=D:\Dev\openssl-1.0.0k-x86-windo
ws'
This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    D:/Dev/Ruby200/bin/ruby.exe extconf.rb --with-opt-dir=D:\Dev\openssl-1.0.0k-
x86-windows
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
        --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=D:/Dev/Ruby200/bin/ruby
D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to ge
nerate an executable file. (RuntimeError)
You have to install development tools first.
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header
'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for
'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in p
ostpone'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'
        from D:/Dev/Ruby200/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'
        from extconf.rb:37:in `configure_headers'
        from extconf.rb:17:in `initialize'
        from extconf.rb:474:in `new'
        from extconf.rb:474:in `<main>'


Gem files will remain installed in D:/Dev/Ruby200/lib/ruby/gems/2.0.0/gems/rmagi
ck-2.15.0 for inspection.
Results logged to D:/Dev/Ruby200/lib/ruby/gems/2.0.0/gems/rmagick-2.15.0/ext/RMa
gick/gem_make.out
0
BluesChow
BluesChow

引用来自“sevk”的评论

gem install rmagick 什么提示?发来看看,虽然不是很懂
请帮看下我回答里面的贴出的错误代码,非常感谢!
0
sevk
sevk


checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** extconf.rb failed ***

 


google 搜索 "ruby stdint.h" 试试

BluesChow
BluesChow
谢谢协助,因为依赖于imagemagick的缘故,正确安装了它之后就好了。
0
老法海
老法海
记得应该是依赖于 imagemagick ? 
老法海
老法海
回复 @BluesChow : :)
BluesChow
BluesChow
嗯,确实是依赖于imagemagick,正确安装好它之后就好了,谢谢
返回顶部
顶部