2011-04-02 49 views
0

我在win7 64位和mysql 5.1上運行軌3時遇到了錯誤。在軌道3上的紅寶石問題在Windows 7上

它與mysql2有關。任何援助都會有所幫助。

C:\mobile_projects>rails new test2 -d mysql 
     create 
     create README 
     create Rakefile 
     create config.ru 
     create .gitignore 
     create Gemfile 
     create app 
     create app/controllers/application_controller.rb 
     create app/helpers/application_helper.rb 
     create app/mailers 
     create app/models 
     create app/views/layouts/application.html.erb 
     create config 
     create config/routes.rb 
     create config/application.rb 
     create config/environment.rb 
     create config/environments 
     create config/environments/development.rb 
     create config/environments/production.rb 
     create config/environments/test.rb 
     create config/initializers 
     create config/initializers/backtrace_silencers.rb 
     create config/initializers/inflections.rb 
     create config/initializers/mime_types.rb 
     create config/initializers/secret_token.rb 
     create config/initializers/session_store.rb 
     create config/locales 
     create config/locales/en.yml 
     create config/boot.rb 
     create config/database.yml 
     create db 
     create db/seeds.rb 
     create doc 
     create doc/README_FOR_APP 
     create lib 
     create lib/tasks 
     create lib/tasks/.gitkeep 
     create log 
     create log/server.log 
     create log/production.log 
     create log/development.log 
     create log/test.log 
     create public 
     create public/404.html 
     create public/422.html 
     create public/500.html 
      create public/favicon.ico 
     create public/index.html 
     create public/robots.txt 
     create public/images 
     create public/images/rails.png 
     create public/stylesheets 
     create public/stylesheets/.gitkeep 
     create public/javascripts 
     create public/javascripts/application.js 
     create public/javascripts/controls.js 
     create public/javascripts/dragdrop.js 
     create public/javascripts/effects.js 
     create public/javascripts/prototype.js 
     create public/javascripts/rails.js 
     create script 
     create script/rails 
     create test 
     create test/fixtures 
     create test/functional 
     create test/integration 
     create test/performance/browsing_test.rb 
     create test/test_helper.rb 
     create test/unit 
     create tmp 
     create tmp/sessions 
     create tmp/sockets 
     create tmp/cache 
     create tmp/pids 
     create vendor/plugins 
     create vendor/plugins/.gitkeep 

C:\mobile_projects>cd test2 

C:\mobile_projects\test2>rails generate scaffold testtbl desc:string legsnumber:string 
[31mCould not find gem 'mysql2 (>= 0, runtime)' in any of the gem sources listed in your Gemfile.[0m 

C:\mobile_projects\test2> 
+1

你的gemfile中有mysql嗎? – sscirrus 2011-04-02 21:51:04

回答

1

我解決this..i只需走進Gemfile中,改變了mysql2提及MySQL和東西工作得很好...

3

您提供的輸出中的最後一行清楚地表明您錯過了什麼。它提到沒有安裝gem mysql2,並且您應該運行bundle install來安裝它們。

你沒有提到你如何獲得該版本的Ruby,但我會假設你安裝了Rubyinstaller包。

現在,mysql2 gem目前缺少Windows的二進制文件(這是我正在處理的東西)。

我有兩個建議:無論您使用的sqlite3(它應該制定出與RubyInstaller盒子或專門RailsInstaller

或者你下到RubyInstaller wiki發佈有關安裝的那些類似的說明進行安裝和編譯mysql2寶石。和編譯MySQL適配器。

希望這一切都有助於或有意義。

+0

我安裝了使用instantrhodes的ruby ..我實際上計劃使用sql server,但我似乎無法得到它與rails 3的工作。安裝myql2 gem也給出了一個錯誤...我會嘗試從rubyinstaller wiki的建議..謝謝 – femi 2011-04-03 09:29:49