problemas instalar failed error applying mysql ruby-on-rails macos installation

failed - error al instalar mysql apply security settings



Problemas de instalaciĆ³n de MYSQL (3)

Después de actualizar algunas gemas a través de la terminal en mi Mac, he creado un nuevo proyecto de raíles respaldado por una base de datos mysql. Al iniciar la aplicación, aparece la página de bienvenida regular a bordo.

Aquí está el problema: intenté hacer clic en el enlace titulado "Acerca del entorno de su aplicación", recibo el siguiente resultado en mi navegador:

MissingSourceFile in Rails/infoController#properties no such file to load -- mysql

También recibo esta salida en la terminal

The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. Processing Rails::InfoController#properties (for 127.0.0.1 at 2008-12-09 20:41:41) [GET] Processing Rails::InfoController#properties (for 127.0.0.1 at 2008-12-09 20:41:41) [GET] MissingSourceFile (no such file to load -- mysql): ...

Como dice, traté de emitir "gem install mysql" después de detener la aplicación, solo para ser saludado por este fragmento de jerga que no puedo comprender:

WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren''t both writable. WARNING: You don''t have /Users/mymac/.gem/ruby/1.8/bin in your PATH, gem executables will not run. Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql 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... 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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 Gem files will remain installed in /Users/mymac/.gem/ruby/1.8/gems/mysql-2.7 for inspection. Results logged to /Users/mymac/.gem/ruby/1.8/gems/mysql-2.7/gem_make.out

Claramente, hay algo mal con mi instalación mysql, ya que también he intentado ejecutar el comando rake para crear la base de datos, lo que me llevó a lo siguiente.

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! no such file to load -- mysql (See full trace by running task with --trace)

Sin embargo, cuando ejecuto "mysql --version" en la línea de comandos, ¡mysql está instalado!

mysql Ver 14.12 Distrib 5.0.67, for apple-darwin9.4.0 (i686) using readline 5.1

También probé a emitir "sudo gem install mysql", sin embargo, eso fue en vano:

sudo gem install mysql Password: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql 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... no checking for mysql_query() in -lmysqlclient... no Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

También probé a emitir "sudo gem install mysql --con mysql-config = / usr / local / mysql / bin / mysql_config" según las instrucciones de bradheintz, que parecía haberse instalado bien, pero después de intentar ver el entorno de la aplicación ¡nuevamente, no se produce el menú desplegable Ajaxy y la aplicación Rails se detiene por completo! El siguiente resultado se imprime justo antes de que la aplicación decida morir en mi jaja.

dyld: lazy symbol binding failed: Symbol not found: _mysql_init Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle Expected in: dynamic lookup dyld: Symbol not found: _mysql_init Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle Expected in: dynamic lookup Trace/BPT trap

Si alguien puede entender lo que está sucediendo aquí, y cómo resolver este problema, estaría muy agradecido :)


El problema es que MySQL gem construye extensiones nativas y necesita información específica del sistema sobre dónde encontrar ciertas bibliotecas. Debes proporcionar esto en la línea de comando.

Echa un vistazo a esta página ; la parte importante (que funcionó para mí, de todos modos) fue:

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

Por supuesto, asegúrese de sustituir la ruta correcta para su propio sistema.

Además, quédese con ejecutar sus comandos de gem install través de sudo .

El problema más grande es que el software gem no brinda ninguna retroalimentación con respecto al hecho de que no se puede simplemente hacer la gem install mysql como lo hace con cualquier otra gema (y de hecho, solía ser capaz de hacer con la gema MySQL).


Intenta forzar la compilación de la versión de 32 bits solamente (suponiendo que estés en Intel Mac, la -V con gema debería darte más salida detallada)

sudo env ARCHFLAGS="-arch i386" gem install -V mysql -- --with-mysql-config=/usr/local/sql32/bin/mysql_config

Más información en esta publicación de blog: http://blog.pastie.org/2008/10/mysql-64-bit-ruby-32-bit-friends-again.html


La última vez que vi este error fue cuando trato de instalar el adaptador mysql / ruby. Y encuentro el mismo error después de actualizar los rieles en Mac a los rieles 1.2.2 porque 1.2.2 elimina la gema mysql por defecto.

La última vez que encontré me falta el cliente o la biblioteca mysql. Tome Redhat, por ejemplo, puede ir a este enlace e instalar el cliente y la biblioteca de MySQL. http://dev.mysql.com/downloads/mysql/5.0.html#linux-rhel5-x86-32bit-rpms

Déjame saber el resultado.

Joe