2013-05-08 35 views
0

好吧,所以我一直有一段時間讓我的IDE環境安裝Ruby和RoR。到目前爲止,我已經能夠解決的每一個問題,除了一個問題,所以我虛心地問強大的計算器來尋求指導。問題與Mysql2,RoR和Windows 8 x64

我的RubyMine安裝在識別一些已安裝的gem或更具體的SQLite3,Mysql和Mysql2時遇到了問題。在RubyMine上使用Gem快速安裝失敗,但是,在cmd中使用正確的配置安裝gem已成功。雖然這是成功的,但RubyMine不能或不會識別已安裝的gem。 '需要mysql2'(其中'需要rubygems'放在它之前)用RubyMine說明它無法加載這樣的文件。當通過firefox訪問本地主機上的RoR服務器時,我收到一個錯誤信息,說明該gem沒有被加載,我應該將它添加到我的Gemfile中(我應該說明所有上述gem已經在gemfile中,如果沒有,添加它們並運行捆綁安裝),這是令人困惑的。我已經花了幾天時間搜尋interwebs和stackoverflow以獲得解決方案,但似乎沒有任何工作。我甚至嘗試從64位版本的紅寶石2到32位版本和一些以前的版本。

在旁邊註釋,它會更容易在linux發行版中編寫ruby代碼嗎? (如Ubuntu)

目前我在自定義鑽機中使用Windows 8x64上的RubyMine 5.4 IDE。我有三個Ruby SDK可以使用:2.0x64PO,2.0PO和1.9.3,並且安裝了最新版本的Rails。 Rubygems與最新版本的SQLite3,mysql和Mysql2一起安裝,並且通過手動安裝正確安裝。

下面是我嘗試運行時得到的錯誤的副本。

runnerw.exe C:\Ruby200\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/RocYourSockx/RubymineProjects/testerrails/bin/rails server -b 127.0.0.1 -p 3000 -e development 
C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError) 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' 
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/config/application.rb:7:in `<top (required)>' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap' 
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>' 
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/bin/rails:4:in `require' 
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/bin/rails:4:in `<top (required)>' 
    from -e:1:in `load' 
    from -e:1:in `<main>' 

Process finished with exit code 1 
+1

也許這個問題可以幫助你:http://stackoverflow.com/questions/15604058/error-cannot-load-such-file-mysql2-2-0-mysql2-loaderror-on-windows-xp – Mindbreaker 2013-05-08 12:53:11

+1

這是不是一個真正的答案,所以我會使用評論。很久以前,我放棄了在窗戶上做鐵軌。相反,我用ubuntu和samba共享啓動一個VM(VMWare播放器)。我的項目文件在共享文件夾中,我可以在窗口上使用崇高的文本編輯它們,同時訪問我的虛擬機中的終端。 我放棄了wondows,只是因爲遇到了比posix操作系統更多的問題,並且在線上幾乎沒有任何幫助。 – Syl 2013-05-08 13:06:11

+0

在Linux上會更容易嗎?是。它會更有效率嗎?不必要。設置你的環境會更快,但一旦完成,它大致相同。 (至少,根據我對Windows 7和Ubuntu的經驗)。如果您有選擇在Linux中執行此操作,請執行此操作! RubyMine可用於Linux。如果你沒有選擇,不要嚇壞了。 Windows安裝程序是可能的。這只是血腥的困難。 – 2013-05-08 13:25:36

回答

1

爲了回答你的問題,ruby + windows是一個痛苦的,痛苦的過程。安裝VirtualBox和現代Ubuntu虛擬機可能會更好。讓寶石在窗戶下工作可能會很麻煩。

我使用OSX的工作,和我目前設立在這裏的Ubuntu的鏡像:http://virtualboxes.org/images/ubuntu/在我的家用筆記本,只是因爲我厭倦了試圖在Windows 7的生產

+1

雖然在Windows上設置可能會很痛苦(一種殘忍,殘忍,令人虛弱的痛苦),但一旦完成,它就會非常順利地航行。我專門在Windows 7上編寫代碼,發現自己非常有成效。 - 不要誤解我的意思,但是,如果我能負擔得起,我肯定會在Mac上編碼。 - – 2013-05-08 13:22:16

+0

感謝大家的幫助。讀完大家的回覆之後,我想我會咬緊牙關,安裝linux的虛擬機。我可以記得當我在Windows 7x64中使用Python時發生的相同類型的事情,所以我去了Ubuntu,這對於使用Python編寫代碼非常有用。看起來好像是一個很好的選擇,對Ruby編碼也是一個很好的選擇。 – 2013-05-09 00:05:34