目前尚不清楚如果您試圖在RailsInstaller之上混合RubyInstaller,這是不推薦的。
然而,最常見的原因,爲什麼這個失敗完全是因爲你在一個目錄與空間(Program Files (x86)
)
在安裝過程中安裝了它,RailsInstaller設置一個建議的默認安裝到C:\RailsInstaller
。
上類似於,RubyInstaller強烈建議避免與空間路徑安裝(在安裝屏)
Ruby和一些庫有問題與空間的路徑,這就是爲什麼推薦安裝目錄爲C:\Ruby193
爲RubyInstaller 1.9.3
路徑中的這些空格影響了C擴展等庫的編譯,以及某些情況下實際執行的程序。
雖然社區一直在努力解決這些問題,但直到Ruby 2.0發現大部分問題已經被Ruby解決。
正如RubyInstaller Troubleshooting page
Specially, pay attention to INSTALLATION DIRECTORY and GEM PATH
If you notice those directories contain spaces, it might be because you installed Ruby in a folder with spaces (highly not recommended) or because another environment variable in your system is interfering. Directories with spaces often cause problems for the DevKit’s GCC compiler.
記錄現在,在錯誤的回溯:
C:/Program Files (x86)/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid switch in RUBYOPT: -F (RuntimeError)
它表示別的東西與RUBYOPT
環境變量的干擾。
我建議你卸載這些修改和:
,然後再次嘗試。
如果您不想手動處理所有組件的安裝,那麼也許您應該對RailsInstaller進行相同的嘗試(默認爲全新安裝)。
請注意,RailsInstaller 已經包含DevKit,所以不需要單獨安裝。
最後但並非最不重要的一點是,如果您下載單獨的DevKit,則對於您安裝的Ruby版本使用正確的DevKit非常重要。這在RubyInstaller downloads page提到:
Down this page, several and different versions of Development Kits (DevKit) are listed. Please download the right one for your version of Ruby:
Ruby 1.8.6 to 1.9.3: tdm-32-4.5.2
Ruby 2.0.0: mingw64-32-4.7.2
Ruby 2.0.0 x64 (64bits): mingw64-64-4.7.2
希望有所幫助。
對不起,我想談論'RailsInstaller'而不是'RubyInstaller',我沒有安裝'RubyInstaller'。我將嘗試在'C:\ RailsInstaller'中重新安裝'RailsInstaller'以避免出現空格。我會告訴你。謝謝! – Ouadie 2013-04-28 17:08:34