2011-05-02 3 views
1

문제 해결 : MySQL의 2.8.1 보석이 솔루션은 제거하는 것이 었습니다MySQL의 보석이 제대로 구축

의 MySQL 5.5.x 잘 재생되지 않습니다 MySQL (지침 사용 가능 here 사용). 그리고 나서 MySQL.com의 x86_64 설치 프로그램을 사용하여 MySQL 5.1.56을 설치하십시오.

아래와 같이 내 .rvm 폴더 권한을 재설정 한 다음 RVM 사이트의 지침에 따라 MySQL gem을 설치했습니다.

성공!

원래 질문 :

내가 실행하고 있습니다 :

  • OSX 10.6.7을 Core2Duo 64 비트 맥북 에어
  • RVM 1.6.5
  • 루비 1.8.7 (2011 ~에 02-18 패치 레벨 334) [i686-darwin10.7.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03/Mach-O 64 비트 실행 가능 x86_64 (이 Ruby 버전은 --default로 설정 됨)
  • MySQL은 5.5.11/마하-O 64 비트 실행 x86_64에 내가 인터넷에서 모든 명령을 사용하여 MySQL의 보석을 설치하려고 시도했습니다

(MySQL.com DMG 설치 프로그램을 사용하여 설치). rake db:migrate을 실행하면 uninitialized constant MysqlCompat::MysqlRes

  1. rvmsudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
  2. sudo env ARCHFLAGS="-arch x86_64" rvmsudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
  3. sudo env ARCHFLAGS="-arch x86_64" rvmsudo gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include

와 오류를 uninitialized constant MysqlCompat::MysqlRes

다음 설치 명령이 모든 결과를 얻을 수 그리고 이러한 명령도 설치하지 마십시오. 나는 또한 ~/.rvmrcrvm_archflags="-arch x86_64"에 놓여있다 Permission denied - /Users/Jake/.rvm/gems/ree-1.8.7-2011.03/gems/mysql-2.8.1/COPYING

  1. gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
  2. env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
  3. sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
  4. sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include

: 난 그냥이 오류가 발생합니다. 아무런 효과가 없었다.

나는 RVM을 내파하고 처음부터 두 번 시작했습니다. 나는 MySQL을 제거하고 다시 설치했다.

내가 뭘 잘못하고 있니? 그 밖의 무엇을 시도 할 수 있습니까? 도와 줘서 고마워!

+0

"초기화되지 않은 상수 MysqlCompat :: MysqlRes"를 시도 종류의 데이터베이스 냄새 .yml 파일이 올바르지 않습니다. 나는 그것이 당신의 데이터베이스 타입 (MySQL, Postgresql 등)을 정의하기 때문에 Rails는 그 정보를 읽고 자동으로'MysqlCompat :: MysqlRes' 상수를 포함해야하는 올바른 gem을 사용해야한다고 생각합니다. –

답변

1

규칙 # 1, RVM으로 작업 할 때. Do NOT use sudo.

DO NOT use sudo...

to work with RVM gems. When you do sudo you are running commands as root, another user in another shell and hence all of the setup that RVM has done for you is ignored while the command runs under sudo (such things as GEM_HOME, etc...). So to reiterate, as soon as you 'sudo' you are running as the root system user which will clear out your environment as well as any files it creates are not able to be modified by your user and will result in strange things happening. (You will start to think that someone has a voodoo doll of your application...)

귀하의 권한은 모든 당신이 그 문제를 해결해야합니다, 당신은 sudo 사용했기 때문에 망쳐, 이렇게됩니다

sudo chown -R Jake ~/.rvm 

당신에게 모든 파일의 소유권을 복원해야합니다.

다음은 the directions on the RVM site for dealing with MySQL입니다. RVM의 저자보다 잘 알고있는 사람이 없기 때문에 인터넷을 통해 지시 사항을 따르지 마십시오.

1

cd `rvm gemdir` 
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config