【发布时间】:2014-09-26 05:56:31
【问题描述】:
我正在尝试将 ruby-odbc gem 安装在 Mac OS X 10.9 上的 ruby-1.9.3-p547 下,以便与通过 ODBC 连接到 SAP 系统的 rails 2.3.12 应用程序一起使用。
环境
- Mac OS X 10.9(小牛队)
- 安装了 ruby 1.9.3 和其他 ruby 的 RVM
- Gems for Rails 2.3.12 应用程序
- 酿造
- 已安装 iODBC
情况
gem系统在执行时构建失败
gem install ruby-odbc
抱怨找不到sql.h
ERROR: sql.h not found
然后我尝试通过
告诉 gem 安装环境 ODBC 标头的位置gem install ruby-odbc -- --with-odbc-dir=/usr/local/iODBC
但这仍然失败并显示以下消息(基本上仍然找不到 sql.h 头文件)。
此时 - 由于无法构建 gem 而被卡住
This could take a while...
ERROR: Error installing ruby-odbc:
ERROR: Failed to build gem native extension.
/Users/grantsayer/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb --with-odbc-dir=/usr/local/iODBC --with-odbc-include=/usr/local/iODBC/include
checking for version.h... no
checking for sql.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
--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/grantsayer/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
--with-odbc-dir
--with-odbc-include=${odbc-dir}/include
--with-odbc-lib
--without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found
extconf failed, exit code 1
【问题讨论】:
-
一个附加项 - 请注意,如果我在 gem 之外构建 odbc.bundle;即使用下载的源包并运行 ruby -Cext extconf.rb
标签: ruby-on-rails odbc unixodbc