programing

Ubuntu에 mysql gem을 설치하는 데 문제가 있습니다.

yoursource 2022. 9. 23. 22:45
반응형

Ubuntu에 mysql gem을 설치하는 데 문제가 있습니다.

mysql 2.8.1 gem을 설치하려고 합니다.Ubuntu 10.04에서 Rails 2.0.2 어플리케이션을 구축하기 위해 사용합니다.Ruby 1.8.7을 사용하고 있습니다.개발 의존관계(기타 보석)를 설치했습니다.어떤 이유로 설치할 수 없습니다.나는 그것을 어떻게 고쳐야 할지 정확히 알 수가 없다.도와주세요!!

인스톨 하려고 하면, 단말기에 다음의 메세지가 표시됩니다.

mohnish@pc146724-desktop:~/Downloads$ sudo gem install mysql-2.8.1.gem 
Building native extensions.  This could take a while...
ERROR:  Error installing mysql-2.8.1.gem:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** 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=/usr/bin/ruby1.8
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
mohnish@pc146724-desktop:~/Downloads$ 

도와주셔서 감사합니다!!

이것을 실행한 후 mysql gem을 설치합니다.

sudo apt-get install libmysqlclient-dev 

그게 부족하면 이렇게 해봐.

 sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev

이것을 실행한 후 mysql gem을 설치합니다.

sudo apt-get install libmysqlclient-dev libmysqlclient16

이것은 sudo gem install mysql을 실행한 후에 동작했습니다.

매뉴얼이 아직 올바르게 설치되지 않았습니다('정의 없음' 오류가 많이 발생하지만, 이는 그다지 중요하지 않습니다).

오류 메시지에 표시된 대로 mkmf.log를 확인해야 합니다.find /usr/lib/ruby/gems/1.8/gems/ -name mkmf.log 를 사용하여 이 파일을 검색합니다.일반적으로 이 오류 메시지는 설치하려는 확장의 -dev 패키지를 설치하지 않았기 때문에 표시됩니다.따라서 mysql gem을 설치하는 경우 libmysqlclient14-dev를 먼저 설치하는 것을 잊었을 수 있습니다.apt-cache search | grep dev 를 실행하여 적절한 패키지를 찾습니다.

자세한 내용은 이쪽을 확인해 주세요.

제 경우, 다음과 같은 에러 메세지가 표시됩니다.

mysql 중 continue.mysql(2.8.1)을 계속 진행할 수 .「 」가 되어 것을 확인합니다.gem install mysql -v '2.8.1'번들 전에 성공합니다.

gem install mysql -v '2.8.1'이치노메시지가 떴습니다.

다음과 같이 수정했습니다.

  • (1 (1): 하다: 실행하다.sudo apt-get install libmysqlclient-dev

  • (2 mysql: " " (2): install mysql:gem install mysql -v 2.8.1

다음과 같은 성공 메시지가 나타납니다.

mysql-2.8.되었습니다.
1 .8.1 1 gem

제 답변이 도움이 됐으면 좋겠어요.

언급URL : https://stackoverflow.com/questions/4613116/difficulties-installing-mysql-gem-on-ubuntu

반응형