我正在尝试为我的rails框架安装rmagick gem。 我已经安装了imagemagick并设置了lib并在系统变量中包含了路径
但是当安装gem install rmagick时 - ' - with-opt-dir =“c:\ RailsInstaller \ ImageMagick-6.7.9-Q8”'我仍然会收到错误。
gem命令
C:\sites\redmine> gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
gem.bat : ERROR: While executing gem ... (OptionParser::InvalidOption)
At line:1 char:4
+ gem <<<< install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6
.7.9-Q8"'
+ CategoryInfo : NotSpecified: (ERROR: While e...:InvalidOption)
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
invalid option: --with-opt-dir=c:\RailsInstaller\ImageMagick-6.7.9-Q8
mkmf.log文件说
assert_minimum_ruby_version!: checking for Ruby version >= 1.8.5... -------------------- yes
--------------------
"gcc -o conftest.exe -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0/ruby/backward -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/RailsInstaller/Ruby2.1.0/lib -L. -lCORE_RL_magick_ -lX11 -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lX11
collect2.exe: error: 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 */
从日志中可以看出,devkit无法找到ImageMagick 但我已将其设置为PATH = C:\ RailsInstaller \ ImageMagick-6.7.9-Q8
答案 0 :(得分:0)
您是否考虑过用亚硝酸盐开发?在Windows中开发rails更加困难,因为你需要处理很多错误而其他人没有,并且没有大量的文档/支持。大多数答案归结为“窗户和导轨不混合”之类的东西。