3

나는 윈도우 7과에 연결 MySQL을 (내가 을 확인하고 일) 그때 레일을 설치 내가"에 WEBrick"를 실행하는 일부 문제

에서 프로젝트를 만들에 (rubyInstaller와) 루비 1.9.2p290를 설치 한 후

:

순서와 "C Amiref이 사이트 \ simple_cms \ 문서 \ \ \ 사용자": 내가 사용하는 경우 다음 "새 simple_cms -d mysql을 레일은"나는 에이 오류를 보았다에 WEBrick 실행 "서버를 레일" 명령 프롬프트 :

"rails.bat : 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in 
`require': Incorrect MySQL client library version! This gem was compile 
d for 6.0.0 but the client library is 5.1.45. (RuntimeError) 
At line:1 char:6 
+ rails <<<< server 
+ CategoryInfo   : NotSpecified: (C:/Ruby192/lib/... 
(RuntimeError):String) [], RemoteException 
+ FullyQualifiedErrorId : NativeCommandError 

from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in 
`<top (required)>' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in 
`require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in 
`<top (required)>' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in 
`require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in 
`block (2 levels) in require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in 
`each' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in 
`block in require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in 
`each' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in 
`require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:122:in 
`require' 
from 
C:/Users/Amiref/Documents/Sites/simple_cms/config/application.rb:7:in 
`<top (required)>' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:52:in 
`require' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:52:in 
`block in <top (required)>' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in 
`tap' 
from 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in 
`<top (required)>' 
from script/rails:6:in `require' 
from script/rails:6:in `<main>' 
" 
+0

"잘못된 MySQL 클라이언트 라이브러리 버전!이 보석은 6.0.0 용으로 컴파일되었지만 클라이언트 라이브러리는 5.1.45입니다." – Phrogz

+0

내가 알기로는, 내가 어떻게이 문제를 풀 수 있는지, 나는 결코 그것을 묻지 않는다. 지금 내가 어떻게 해결할 수 있는지 안다면 저를 도와주세요. – ainternet73

+0

업데이트 된 버전의 MySQL을 설치 하시겠습니까? 이전 버전의 gem을 설치 하시겠습니까? – Phrogz

답변

2

오류 메시지를 읽으십시오. MySQL 보석에는 6.0.0 버전이 필요하지만 5.1.45이 설치되어 있어야합니다.

+0

이제이 오류를 해결하려면 어떻게해야합니까? – ainternet73

2

이것은 보석 (아마 mysql 또는 mysql2 중 하나)이 프로젝트에서 사용되었고 그 보석의 바이너리가 설치된 MySQL의 다른 버전과 비교하여 컴파일 되었기 때문에 발생합니다.

mysql과 mysql2 보석 모두는 PATH에 libmysql.dll 라이브러리가 있는지에 따라 다르며, 이는 보석을 만드는 데 사용 된 것과 다를 수 있습니다.

내가, 당신이 설치된 mysql을 제거하는 것이 좋습니다 당신이 어딘가에있는 libmysql.dll 함께 mysql2 보석 것입니다 당신이 libmysql.dll

의 특정 버전을 얻을 수있는 위치에 대한 설치 노트를 씹어 그 보석을 설치하는 Bundler 프로그램을 사용하는 대부분의 경우 당신의 PATH 및 지침은 여기에 설명 따르

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

당신은 MySQL은 자체의 설치를 생략하지만, MySQL의 커넥터/C 바이너리의 사용 (우편 아카이브하지 설치) 방법에주의를 지불 할 수 그것을 설치하십시오.

bundle check 

그래서이 지역에 설치된 버전을 반영 : 당신은 MySQL의 또는 mysql2 보석 중 하나를 설치 (설치 지침이 모두 작동), 번들을 업데이트하십시오 완료하면

.

희망이 있습니다.

12

최신 레일이나 루비는 mysql-connector-c-6 (libmysql.dll)을 사용하여 mysql2-0.3.11-x86-mingw32를 컴파일하므로 6 클라이언트 DLL을 사용해야한다.

MySQL의 커넥터-C-6 사용 RailsInstaller (Ruby1.9.2를) 할 수있는 쉬운 방법이있다 :

  1. 다운로드 mysql-connector-c-noinstall-6.0.2-win32.zip
  2. mysql-connector-c-noinstall-6.0.2-win32.zip의 압축을 풀고 RailsInstaller \ Ruby1.9.2 \ bin에 copu mysql-connector-c-noinstall-6.0.2-win32 \ lib \ libmysql.dll을 압축 해제하십시오.

그런 다음 레일즈 서버를 실행하면 모든 것이 정상입니다.

+0

다음 링크에서 mysql 커넥터를 다운로드 할 수 있습니다. http://dev.mysql.com/downloads/connector/c/ –

+0

nice one! 고맙습니다! – Francois

+0

mysql2를 설치하면, 유용한 메시지가 표시되며 위의 링크를 통해 libmysql.dll의 올바른 버전으로 연결됩니다. 그러나 bundler로 보석을 설치하면 bundler가 메시지를 먹습니다! – antinome