0

我整晚都在尝试,到目前为止还无法在我的 Debian 测试 64 位系统上为 ruby​​ 编译 mysql gem。

我相信这是因为我安装了 openssl v1.0.0 库。

这是我尝试安装时得到的结果(使用 RVM 1.14.7 和 Ruby 1.9.1p431):

gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

        /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/bin/ruby extconf.rb
checking for mysql_ssl_set()... *** 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
    --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=/home/jarrett/.rvm/rubies/ruby-1.9.1-p431/bin/ruby
    --with-mysql-config
    --without-mysql-config
/home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:417:in `try_link0'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:421:in `try_link'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:529:in `try_func'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:774:in `block in have_func'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:250:in `open'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:250:in `open'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:272:in `postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:773:in `have_func'
    from extconf.rb:45:in `<main>'


Gem files will remain installed in /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1 for inspection.
Results logged to /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

当我检查 mkmf.log 文件时(位于/home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1/ext/mysql_api/mkmf.log,它是空的)。

我试过的

1)确保安装了所有必需的开发包(libssl-dev libopenssl-ruby build-essential gcc autoconf automake libmysql-ruby ruby​​-mysql libmysqld-dev ruby​​-dev)

2) 我最初安装了更新的 RVM - 我将其卸载并重新安装了早期版本的 RVM。我这样做了(按照这些说明:undefined symbol: SSLv2_method when trying to run Thin webserver)希望我可以运行rvm pkg install openssl(在本地安装了 openssl 0.9.8),然后用这个:rvm install 1.9.1 --with-openssl-dir=/home/jarrett/.rvm/usr. 我希望这将使用 0.9.8 版本的 openssl。没有骰子。

3)尝试将本地 openssl 0.9.8 导出到LD_LIBRARY_PATHwith export LD_LIBRARY_PATH=/home/jarrett/.rvm/usr/lib,然后再次运行安装。没有骰子。

4) 通过 RVM 安装 ruby​​ 1.9.2 和 1.9.3 并尝试它们。没有骰子。

5) 对着电脑大喊大叫。没有骰子。

有人有任何想法/建议吗?

也许 mysql gem 有可能很快更新为使用 openssl 1.0.0 吗?

4

1 回答 1

0

想不通,所以我按照这些说明安装了 openssl 0.9.8(未定义的符号:SSLv2_method 在尝试运行 Thin webserverhttps://rvm.io/packages/openssl/时),然后安装了 mysql2 gem 并改用它。

于 2013-04-25T14:57:26.527 回答