Program Tip

MySQL 설치 : 오류 : gem 기본 확장을 빌드하지 못했습니다.

programtip 2020. 10. 22. 22:23
반응형

MySQL 설치 : 오류 : gem 기본 확장을 빌드하지 못했습니다.


라인 어딘가에 설치가 잘못되어 MySQL을 최신 버전으로 설치하려고합니다. 명령을 실행하고 gem install mysql다음을받습니다.

기본 확장 빌드. 시간이 걸릴 수 있습니다 ... 오류 : mysql 설치 오류 : 오류 : gem 기본 확장을 빌드하지 못했습니다.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin in PATH, mode 040777 extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 extconf.rb : 7 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 mkmf.rb는 / System에서 ruby에 대한 헤더 파일을 찾을 수 없습니다. /Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem 파일은 검사를 위해 /Library/Ruby/Gems/1.8/gems/mysql-2.8.1에 설치되어 있습니다. /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out에 기록 된 결과

나는 특정 버전을 설치하는 것부터 운없이 루비를 재설치하는 것까지 모든 것을 검색하고 시도했습니다.

내가 잘못 될 수있는 아이디어가 있습니까?

라인 어딘가에 설치가 잘못되어 MySQL을 최신 버전으로 설치하려고합니다. 명령을 실행하고 gem install mysql다음을받습니다.

기본 확장 빌드. 시간이 걸릴 수 있습니다 ... 오류 : mysql 설치 오류 : 오류 : gem 기본 확장을 빌드하지 못했습니다.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin in PATH, mode 040777 extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 extconf.rb : 7 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 mkmf.rb는 / System에서 ruby에 대한 헤더 파일을 찾을 수 없습니다. /Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem 파일은 검사를 위해 /Library/Ruby/Gems/1.8/gems/mysql-2.8.1에 설치되어 있습니다. /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out에 기록 된 결과

나는 특정 버전을 설치하는 것부터 운없이 루비를 재설치하는 것까지 모든 것을 검색하고 시도했습니다.

내가 잘못 될 수있는 아이디어가 있습니까?

편집 : Snow Leopard DVD에서 XCode를 설치했는데 오류가 다음과 같이 약간 변경되었습니다.

기본 확장 빌드. 시간이 걸릴 수 있습니다 ... 오류 : mysql 설치 오류 : 오류 : gem 기본 확장을 빌드하지 못했습니다.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin in PATH, mode 040777 extconf.rb : 4 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 extconf.rb : 7 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin PATH, 모드 040777 extconf.rb : 17 : 경고 : 안전하지 않은 세계 쓰기 가능 dir / usr / bin in PATH, mode 040777 check for mysql_query () in -lmysqlclient ... no check for main () in -lm ... yes check for mysql_query () in -lmysqlclient ... no check for main () in- lz ... yes -lmysqlclient에서 mysql_query () 확인 중 ... -lsocket에서 main () 확인 안 함 ... -lmysqlclient에서 mysql_query () 확인 안 함 ... -lnsl에서 main () 확인 안 함. .. -lmysqlclient에서 mysql_query () 확인 안함 ... -lmygcc에서 main () 확인 안함 ...-lmysqlclient에서 mysql_query ()를 확인하지 않습니다.* extconf.rb 실패 * 어떤 이유로 인해 Makefile을 생성 할 수 없습니다. 필요한 라이브러리 및 / 또는 헤더가 부족한 것 같습니다. 자세한 내용은 mkmf.log 파일을 확인하십시오. 구성 옵션이 필요할 수 있습니다.

제공되는 구성 옵션 : --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 = / System / Library / Frameworks / Ruby.framework / Versions / 1.

Gem 파일은 검사를 위해 /Library/Ruby/Gems/1.8/gems/mysql-2.8.1에 설치되어 있습니다. /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out에 기록 된 결과

명령 줄에서 "which mysql"을 수행하면 아무 것도 반환하지 않습니다. 이는 인식하지 못한다는 의미입니다. MySQL 시스템 환경 설정 옵션도 설치했는데 MySQL 실행을 중지 할 수 없습니다. 이제 나는 무엇을 해야할지 완전히 갇혀 있습니다!

편집 편집

이 가이드 http://hivelogic.com/articles/installing-mysql-on-mac-os-x를 사용하여 MySQL을 완전히 다시 설치했습니다 .

불행히도 이것도 작동하지 않았지만 여전히 동일한 오류가 발생합니다. 명령 줄에서 mysql -uroot를 수행 할 수도 없습니다. 오류가 발생합니다.

오류 2002 (HY000) : '/tmp/mysql.sock'소켓을 통해 로컬 MySQL 서버에 연결할 수 없습니다 (2).

그래서 나는 모든 것을 시도했다고 생각합니다.

** 해결 *

죄송합니다. 이것이 작동하지 않는 이유는 MySQL 경로 때문입니다. 여기에 블로그를 게시했습니다 : http://www.kieransenior.co.uk/2010/02/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/


OSX에 mysql gem 설치

터미널에서 .. 먼저 'locate mysql_config' 를 수행 한 후 다음 명령의 경로를 해당 파일이있는 경로로 바꿉니다 .

$ sudo gem install mysql -- —–with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while…
Successfully installed mysql-2.7
1 gem installed

Debian (또는 Ubuntu) 시스템에서는 다음을 사용하여 libmysqlclient-dev 패키지를 설치하면됩니다.

sudo apt-get install libmysqlclient-dev

그리고:

gem install mysql

오류없이 설치됩니다.


우선 MySQL as Server, MySQL as Client 및 MySQL에 대한 Ruby 바인딩을 구별해야합니다.

저는 Mac에 익숙하지 않지만 * nix OS의 경우 패키지 관리자를 통해 MySQL을 설치해야합니다. Ruby 바인딩을 설치하려면

gem install mysql

ruby의 개발 헤더 (Ubuntu에서는 ruby-dev 패키지)와 MySQL-Client (현재 libmysqlclient16-devUbuntu) 의 개발 헤더가 필요합니다 . Mac에서 이름이 다른지 모르겠지만 설치 한 후에는 Ruby 바인딩이 오류없이 설치되어야합니다.


많은 사람들 이이 게시물이 유용 하다고 생각 했습니다 .

또한 먼저 다음을 입력해야합니다.

yum install mysql-devel

그리고:

gem install mysql 

일부 사람들의 경우 다음을 입력해야 할 수 있습니다.

gem install mysql -- --with-mysql-config=/usr/local/mysql/mysql_config

OSX mountain Lion : brew설치 한 경우 컴퓨터에 mysql을 사용하여 테스트 데이터베이스를 만드는 방법을 brew install mysql따르십시오 instructions. 끝까지 갈 필요는 없었고, 그럴 필요도 없었습니다. 그 후에는 설치와 레이크를 번들로 묶을 수있었습니다.


해결하기 위해

Gem::Ext::BuildError: ERROR: Failed to build gem native extension error for mysql2,

I think libmysql-ruby got changed with ruby-mysql

Simply try with following commands,

sudo apt-get install ruby-mysql

& then

sudo apt-get install libmysqlclient-dev

I had also forgotten to actually install MySQL in the first place. Following this guide helped a lot.

http://www.djangoapp.com/blog/2011/07/24/installation-of-mysql-server-on-mac-os-x-lion/

As well as adding these lines to my .profile:

export PATH="/usr/local/mysql/bin:$PATH"
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

I had a similar experience, so here are the things that I tried

Firstly, I tried to install mysql's required packages by running the command below in my terminal

sudo apt-get install build-essential libmysqlclient-dev

Secondly, I tried updating rubygems on my system by running the command below in my terminal

sudo gem update --system

But I was still experiencing the same issue. After much research I realized that I was using an almost out-of-date version of the mysql gem. I simply needed to use the mysql2 gem (mysql2 gem)and not the mysql gem, so I fixed it by running the command below in my terminal

gem install mysql2

This worked fine for me. Before running the last command, ensure that you've ran the first and second commands to be sure that everything is fine on your system.

That's all.

I hope this helps


you can try to reinstall the latest version of xcode / dev. tools for snow leopard - this should fix your errors


if you are installing from source here is a tutorial.would be happy if it helps http://raihan90.blogspot.com/2009/03/mysql-step-by-step-hacking-into-mysql.html


Attention: You need to specify -- key, and than --with-mysql-config=/usr/local/mysql/bin/mysql_config


If you use Percona Mysql server

$ yum install Percona-Server-devel-55

$ gem install mysql


yum -y install gcc mysql-devel ruby-devel rubygems
gem install mysql2

Your Ubuntu OS need to install library for mysql client sudo apt-get install libmysqlclient-dev

After That just install bundle or bundle install

참고URL : https://stackoverflow.com/questions/2167598/mysql-install-error-failed-to-build-gem-native-extension

반응형