2012-06-19 70 views
0

我在Netbeans 7.1中設置了一個新的導軌應用程序。無需編寫任何代碼,我想看看,如果它只是運行,但Netbeans Ruby/Rails項目,無法運行,Bundler輸出窗口空白空

當點擊運行我得到的錯誤:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError) 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require' 
    from C:/_PROJECTS/active/Callisto2.0/config/application.rb:7:in `<top (required)>' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap' 
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

我已經安裝了幾個寶石它是通過NetBeans的寶石經理抱怨,但我得到了停留在mysql2。即使我安裝了mysql和mysql2 gem,它仍然不會找到它。

幾乎沒有研究,似乎我必須做一個bundle install,用於WEBrick運行/檢查依賴關係或其他。 Netbeans項目有一個Bundler上下文菜單,包含檢查,初始化,安裝,顯示等選項。

這些都不會在Output:Bundler窗口中產生任何輸出。 Bundler進程在netbeans進程中啓動,但在一秒之後退出。沒有錯誤,信息或任何東西。

我需要做些什麼才能使這項工作。這是一個通過Netbeans 7.1的空白Ruby/Rails應用程序。

編輯1: 在文件中的錯誤:C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2包含以下行:

RUBY_VERSION =~ /(\d+.\d+)/ 
require "mysql2/#{$1}/mysql2" 

沒什麼特別的。我試着改變它到mysql,或者只是「mysql2」,它不起作用。當我評論整行時客戶端未被初始化的錯誤。

回答

0

你得到你的用戶是不允許安裝寶石的消息?

那麼你應該在你的Rails應用程序的根文件夾試試下面的命令

bundle install --path vendor/bundle 

確保有在config文件夾中的可配置database.yml運行前面的命令之前,或創建文件後再次運行。