Ammetto, ho la testa dura

quando cerco di installare mysql2 mi dice quanto sotto riportato:

gem install mysql2
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/gem:4: warning: Insecure world
writable dir /usr/local/rvm/gems/ruby-1.9.2-p290/bin in PATH, mode
042777
Building native extensions. This could take a while…
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

checking for rb_thread_blocking_region()… yes
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/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
–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/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7 for inspection.
Results logged to
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/ext/mysql2/gem_make.out

perchè? come se non trovasse qualcosa, ma cosa?
aggiungo che in /var/run/mysqld/ c’è mysqld.sock
il sistema ora è ubuntu server

Quando ho avuto questo problema in passato, era riconducibile al fatto
che l’installazione della gemma non trovasse l’eseguibile del client
mysql.
Prova a mettere la directory cos:

gem install mysql --with-mysql-dir /path/to/mysql

Alessandro

non cambia…

gem install mysql2 – --with-mysql-dir=/usr/bin/
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/gem:4: warning: Insecure world
writable dir /usr/local/rvm/gems/ruby-1.9.2-p290/bin in PATH, mode
042777
Building native extensions. This could take a while…
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 

–with-mysql-dir=/usr/bin/
checking for rb_thread_blocking_region()… yes
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/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
–with-mysql-config
–without-mysql-config
–with-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/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7 for inspection.
Results logged to
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/ext/mysql2/gem_make.out

idem con patate

On 13 September 2011 11:39, davide isoardi [email protected] wrote:

non cambia…

Potrebbe essere necessario installare libmysqlclient-dev.
( un virtual package, quando farei apt-get install ti dir lui il
pacchetto da installare).

Ciao ciao
Paolo


“… static analysis is fun, again!”

life from an application security guy ~> http://thesp0nge.com

Ok, Paolo vince. Ma oltre a eseguire meramente il comando indicato, sai
dirmi a cosa serviva quel pacchetto?

•••••••••••••••••••••••••••••••••••••••••••
Davide Isoardi

E-mail: [email protected]
iPhone: +39 392 1031631
mobile: +39 346 1688804
•••••••••••••••••••••••••••••••••••••••••••

Il giorno 13/set/2011, alle ore 11:43, Paolo P.
[email protected] ha scritto:

2011/9/13 Abacus [email protected]:

Ok, Paolo vince. Ma oltre a eseguire meramente il comando indicato, sai dirmi a
cosa
serviva quel pacchetto?
Certo. In generale, quando installi un pacchetto su unix vengono
installate anche le librerie che servono per farlo funzionare. Ad
esempio, apt-get install mysql installer tutte le librerie per far
funzionare i binari di mysql.

Se per tu devi compilare un programma che usa funzionalit in quelle
librerie hai bisogno di pezzi in pi, i pacchetti che solitamente
hanno -dev nel nome.

Lo si fa per installare sulla linux box solo le cose che effettivamente
servono.

HTH
Paolo

“… static analysis is fun, again!”

life from an application security guy ~> http://thesp0nge.com

Ringrazio enormemente delle delucidazioni… Grazie

•••••••••••••••••••••••••••••••••••••••••••
Davide Isoardi

E-mail: [email protected]
iPhone: +39 392 1031631
mobile: +39 346 1688804
•••••••••••••••••••••••••••••••••••••••••••

Il giorno 13/set/2011, alle ore 11:57, Paolo P.
[email protected] ha scritto:

sono gli headers necessari a compilare alcune parti binarie (quindi
codice
nativo in C, non ruby) della gemma mysql2

può capitare con diverse gemme (penso a nokogiri o mongo, per esempio).
in quel
caso, controllo l’output di errore, vedi qualche libreria/header è
mancante, e
cercala con apt-cache o aptitude. di norma, dopo un po’ di tentativi,
funziona :wink:

A.

Il 13/09/2011 11:49, Abacus ha scritto: