支持用 rails 2.3 和 ruby 1.8.7 编写的旧版应用程序
1-2 个月前从 OS X 10.9 升级到 10.11 没有问题,安装了 RVM(rvm 1.26.11(最新)),通过酿造安装了 MySQL 5.6.10,旧版应用程序在其 gemset 中运行了 mysql gem。
试图让一个 anaconda2 项目工作 mysql 库文件没有被找到,我在故障排除(非 5.6.10)时通过 brew 卸载了一个旧版本,之后所有 rails 应用程序都不再能够启动(缺少 mysql 依赖项)。
我无法获得任何使用brew的东西,并且在使用brew doctor
清理所有警告后,我仍然无法运行MySQL(服务器),所以我决定重新开始。
使用ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
卸载的啤酒
使用http://downloads.mysql.com/archives/get/file/mysql-5.6.27-osx10.9-x86_64.dmg
重新安装了MySQL
能够将数据重新导入服务器和mysql客户端从终端正确连接。
在故障排除过程中的某个时候,我通过gem uninstall mysql
卸载了mysql,现在尝试重新安装gem,我收到以下错误:
kh@MBP ~/c/main/code/rails/main % gem install mysql --no-ri --no-rdoc -- --with-mysql-config='/usr/local/mysql/bin/mysql_config'
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/kh/.rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... 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=/Users/kh/.rvm/rubies/ruby-1.8.7-head/bin/ruby
--with-mysql-config
Gem files will remain installed in /Users/kh/.rvm/gems/ruby-1.8.7-head@ruby-187/gems/mysql-2.9.1 for inspection.
Results logged to /Users/kh/.rvm/gems/ruby-1.8.7-head@ruby-187/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
所有MySQL文件似乎都在正确的位置:
kh@MBP ~/c/main/code/rails/main % ls -l /usr/local/mysql
lrwxr-xr-x 1 kh staff 27 Mar 18 15:48 /usr/local/mysql -> mysql-5.6.27-osx10.8-x86_64
kh@MBP ~/c/main/code/rails/main % ls -l /usr/local/mysql/bin/*mysql*
-rwxr-xr-x 1 kh staff 1551 Sep 18 2015 /usr/local/mysql/bin/msql2mysql
-rwxr-xr-x 1 kh staff 4750576 Sep 18 2015 /usr/local/mysql/bin/mysql
-rwxr-xr-x 1 kh staff 4838512 Sep 18 2015 /usr/local/mysql/bin/mysql_client_test
-rwxr-xr-x 1 kh staff 16355200 Sep 18 2015 /usr/local/mysql/bin/mysql_client_test_embedded
-rwxr-xr-x 1 kh staff 6425 Sep 18 2015 /usr/local/mysql/bin/mysql_config
任何帮助将不胜感激。
我能够通过删除这些 RVM 红宝石/宝石、升级 RVM、重新编译 ruby 1.8.7 并重新安装我的所有宝石来解决这个问题。似乎是迁移到 el capitan 的问题,旧版本的 RVM 伪装成特定的 mysql 问题。