[英]Issues installing mysql or mysql2 gem
我安裝了ruby版本2.0.0.0p195(2013-05-14)[x64-mingw32]以及安裝的ruby gem版本2.0.3。 我最近還安裝了MySQL Community Server 5.6.12(32位)安裝程序。 我正在嘗試使mysql或mysql2 gem工作,然后安裝服務器以了解有關Ruby on Rails的更多信息。
當安裝mysql2 gem時,出現以下錯誤,任何人都可以指出正確的方向來安裝mysql2 gem,這樣我就可以在使用mysql的Rails上使用ruby,然后最終進行網絡服務。
構建本機擴展。 這可能需要一段時間...
錯誤:錯誤安裝mysql2:錯誤:無法構建gem本機擴展
> C:/Ruby200-x64/bin/ruby.exe extconf.rb checking for
> rb_thread_blocking_region()... *** extconf.rb failed *** Could not
> create Makefile due to some reason, probably lack of necessary
> libraries and/or headers. Check the mkmf.log file for more details.
> You may need configuration options.
>
> Provided configuration options: --with-opt-dir --without-opt-dir
> --with-opt-include --without-opt-include=${opt-dir}/include
> --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog
> --without-make-prog --srcdir=. --curdir
> --ruby=C:/Ruby200-x64/bin/ruby
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler
> failed to generate an executable file. (RuntimeError) You have to
> install development tools first. from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:531:in `try_link' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:717:in `try_func' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1001:in `block in have_func'
> from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:892:in `block in
> checking_for' from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in
> `block (2 levels) in postpone' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in `block in postpone' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:333:in `postpone' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `checking_for' from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1000:in `have_func' from
> extconf.rb:9:in `<main>'
我發現答案(對我來說)是使用Rails安裝程序並卸載舊的ruby信息。 Rails安裝程序包括ruby,rails和sqllite3。 同樣,然后我安裝了從本地主機:3000運行的WEBrick。 它使我可以使用WAMP和Ruby / WEBrick。 這不是理想的,因為並非所有內容都在一個區域上運行,但是它非常適合我需要的學習和我想使用HTML5和/或Rails(媒體應用程序)開發的輔助項目。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.