2013-02-13 105 views
0

我必須從Ruby腳本(版本1.9.3)執行Rails服務器(Rails版本:2.3.4,Ruby版本:1.8.7)。 我的Ruby腳本是:在Windows上從ruby應用程序執行rails服務器

system(start G:/app/Ruby187/bin/ruby.exe G:/app/name_app/script/server) 

當我開始這個劇本,我得到了這樣的結果:

Missing the Rails 2.3.4 gem. Please `gem install -v=2.3.4 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. 

但我安裝了Ruby解釋器1.8.7創業板。實際上,如果我在提示符下執行該命令:

G:/app/Ruby187/bin/ruby.exe G:/app/name_app/script/server 

Rails服務器啓動。 我檢查了環境變量(因爲我的腳本在Ruby 193上運行),但沒有任何結果,輸出是相同的錯誤。

你有什麼想法嗎?

+0

試試這個'系統( 「G:/app/Ruby187/bin/ruby.exe G:/應用/ name_app /腳本/服務器」) ' – Viren 2013-02-13 11:36:34

+0

對不起,但它不起作用,它的輸出與腳本提示中的錯誤相同。 – user2058824 2013-02-13 12:29:25

回答

0

是否定義了寶石的位置?

喜歡的東西:

Set GEM_PATH=/Library/Ruby/Gems/1.8/:${GEM_PATH} 

你會想看看你有你的home目錄或者關閉根寶石。您可以通過運行gem environment

(或)做bundle installgem install rails將解決您的問題。

(或)這將是軌道問題,升級到rails 2.3.8

+0

我想我們想在windows下運行'〜/ .bash_profile'或者'〜/ .bashrc'就是'unix' – Viren 2013-02-13 11:33:25

+0

oops,我忘記了windows的關鍵字....感謝viren – Vinay 2013-02-13 11:34:19

+0

'export' unix'set' windows – Viren 2013-02-13 11:38:38

相關問題