无法通过Homebrew FreeTds在Mac OS X 10.8上捆绑安装tiny_tds [英] Failing to bundle install tiny_tds on Mac OS X 10.8 with Homebrew FreeTds
问题描述
我的问题
我可以采取什么措施确保工作100%正常进行?
我需要真实的指示,而不是一个班轮的答案或对该过程的模糊概念描述.
MY QUESTION
What are some surefire steps I can take to 100% get this working?
I would need real instructions, not one liner answers or vague conceptual descriptions of the process.
让我们深入浅出. 似乎有些地方存在冲突,我在GitHub上的gem开发人员就我在Ruby/Rails/Bundler/Homebrew方面的经验提供了出色的帮助,所以这并非完全是他们的错:P 但是我需要弄清楚如何尽快使该功能正常工作,因此,这与我目前对该问题的状态相符.
Let's get to the bottom of this. It would appear that there are conflicts somewhere and I've had subpar assistance from the gem developer on GitHub in relation to my experience with Ruby / Rails / Bundler / Homebrew so it's not completely their fault :P But I need to figure out how to get this working ASAP so here goes with my current state of this problem.
更新:2013/2/25
更新了GCC/XCODE版本4.6(4H127),并下载了最新版本的XCODE COMMAND-LINE TOOLS
现在,extconf检查器中显示了iconv_open().
现在我得到了这些错误:
UPDATE: 2/25/2013
Updated GCC / XCODE Version 4.6 (4H127) and downloaded latest version of XCODE COMMAND-LINE TOOLS
and now iconv_open() is showing up in the extconf checker.
Now I'm getting these errors:
我相信它们现在存在tiny_tds问题以及与最新xcode路径的兼容性问题.
I believe they are now issues with tiny_tds and compatibility with latest xcode paths.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... yes
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... yes
checking for ct_bind() in -lct... yes
creating Makefile
make
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I-I/usr/local/php5/include -I-I/usr/include -I-I/usr/local/include -I-I/opt/local/include -I-I/usr/local/MacGPG2/include -I-I/opt/sm/pkg/active/include -I/usr/local/php5/include -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/local/MacGPG2/include -I/opt/sm/pkg/active/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c client.c
xcrun: Error: could not stat active Xcode path '/Developer'. (No such file or directory)
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I-I/usr/local/php5/include -I-I/usr/include -I-I/usr/local/include -I-I/opt/local/include -I-I/usr/local/MacGPG2/include -I-I/opt/sm/pkg/active/include -I/usr/local/php5/include -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/local/MacGPG2/include -I/opt/sm/pkg/active/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c result.c
xcrun: Error: could not stat active Xcode path '/Developer'. (No such file or directory)
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DHAVE_ICONV_OPEN -DHAVE_SYBFRONT_H -DHAVE_SYBDB_H -I-I/usr/local/php5/include -I-I/usr/include -I-I/usr/local/include -I-I/opt/local/include -I-I/usr/local/MacGPG2/include -I-I/opt/sm/pkg/active/include -I/usr/local/php5/include -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/local/MacGPG2/include -I/opt/sm/pkg/active/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c tiny_tds_ext.c
xcrun: Error: could not stat active Xcode path '/Developer'. (No such file or directory)
cc -pipe -bundle -undefined dynamic_lookup -o tiny_tds.bundle client.o result.o tiny_tds_ext.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/local/heroku/lib -L/usr/local/php5/lib -L/usr/local/Cellar/ruby/1.9.3-p194/lib -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/usr/local/MacGPG2/lib -L/opt/sm/pkg/active/lib -L/Users/rountrjf/.rvm/lib -L/usr/local/Cellar/vertx/lib -L/usr/local/Cellar/vertx/mods/node.vert.x/lib -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -lruby -lct -lsybdb -lpthread -ldl -lobjc
i686-apple-darwin11-llvm-gcc-4.2: client.o: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: result.o: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: tiny_tds_ext.o: No such file or directory
make: *** [tiny_tds.bundle] Error 1
Alright, since /Developer doesn't exist.
I used `sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer` thinking that would fix it. Now I'm back to square one... iconv_open() not found when checked with `extconf.rb`
更新2:2/25/2013
好的,所以我重新安装了Ruby/Rails/etc等所有内容.
并使用了评论者的一些建议来使用:path =>"
这是我运行rails s
UPDATE 2: 2/25/2013
OKAY, so I reinstalled everything, Ruby / Rails / etc.
And used some advice from a commenter to use ":path =>"
and here is my output now when I run rails s
/Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- tiny_tds (LoadError)
from /Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
from /Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adapter.rb:31:in `sqlserver_connection'
from /Users/rountrjf/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
我尝试过的事情
1.)初始EASY设置说明与其他任何...一样.
1.) The initial EASY setup instructions like any other...
$ rails new test_app
$ cd test_app
现在将这些行添加到Gemfile
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
现在继续命令...
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.6.1)
Using activesupport (3.2.12)
Using builder (3.0.4)
Using activemodel (3.2.12)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.2)
Using actionpack (3.2.12)
Using mime-types (1.21)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.12)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.12)
Using activerecord-sqlserver-adapter (3.2.10)
Using activeresource (3.2.12)
Using bundler (1.2.4)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.7.7)
Using rdoc (3.12.1)
Using thor (0.17.0)
Using railties (3.2.12)
Using coffee-rails (3.2.2)
Using jquery-rails (2.2.1)
Using rails (3.2.12)
Using sass (3.2.5)
Using sass-rails (3.2.6)
Installing tiny_tds (0.5.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/Cellar/ruby/1.9.3-p194/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing.
-----
*** 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/Cellar/ruby/1.9.3-p194/bin/ruby
--enable-lookup
--disable-lookup
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
--with-iconvlib
--without-iconvlib
Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/gems/tiny_tds-0.5.1 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/gems/tiny_tds-0.5.1/ext/tiny_tds/gem_make.out
An error occurred while installing tiny_tds (0.5.1), and Bundler cannot continue.
Make sure that `gem install tiny_tds -v '0.5.1'` succeeds before bundling.
tsql -C
OUTPUT OF tsql -C
$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /usr/local/Cellar/freetds/0.91/etc
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 7.1
iODBC: yes
unixodbc: no
SSPI "trusted" logins: no
Kerberos: no
2.)想象中的成功/伪造直到您完成/大笔放下/高级设置说明
找到此博客条目...
http://talltroym.blogspot.com/2012/04/installing- activerecord-sqlserver.html
2.) IMAGINARY SUCCESS / FAKE IT TIL YOU MAKE IT / A BIG LET DOWN / ADVANCED SETUP INSTRUCTIONS
Found this blog entry...
http://talltroym.blogspot.com/2012/04/installing-activerecord-sqlserver.html
然后我找到了指向libiconv库和freetds库的正确路径. 接下来,我像这样运行它:
I then located my correct paths to the libiconv library and the freetds library. Next, I ran it like this:
$ sudo gem install tiny_tds -- --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib --with-freetds-lib=/usr/local/Cellar/freetds/0.91/lib --with-freetds-include=/usr/local/Cellar/freetds/0.91/include
Password:
Building native extensions. This could take a while...
Successfully installed tiny_tds-0.5.1
1 gem installed
Installing ri documentation for tiny_tds-0.5.1...
Installing RDoc documentation for tiny_tds-0.5.1...
再次尝试gem 'tiny_tds'
在Gemfile中安装...
Tried bundle_install
again, and shock... it still isn't installing via gem 'tiny_tds'
in Gemfile...
所以我从Gemfile中删除了tiny_tds并继续启动服务器... 和预期的一样...
So I remove tiny_tds from Gemfile and proceed to start the server up anyway... And as expected...
$ rails s
=> Booting WEBrick
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- tiny_tds (LoadError)
...
3.)MINI PORTILE
3.) MINI PORTILE
$ sudo gem install mini_portile
$ sudo gem install rakecompiler
$ rake TINYTDS_FREETDS_VERSION="current"
Could not find gem 'tiny_tds (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
其他相关问题和资源
- 在OSX上安装TinyTDS时出错10.6通过gem install tiny_tds (完全没有信息...由于它不起作用 完全是我.)
- FreeTDS Mac OS X MiniPortile (关于微型轻便小车的使用方法或使用方法的信息不多 它...)
- Homebrew/TinyTDS/FreeTDS捆绑包错误 (与linux有关,而不与Mac有关)
- ROR +无法安装tiny_tds
- http://talltroym.blogspot.com/2012/04/installing-activerecord-sqlserver.html (给我虚假希望的博客条目)
- https://github.com/rails-sqlserver/tiny_tds/issues/71 (我在github问题上发表评论,在那儿我收到了一些建议,说我对理解还不够了解,无法转化为成功的故事)
- https://github.com/rails-sqlserver/tiny_tds (github for tiny_tds宝石)
- Error installing TinyTDS on OSX 10.6 via gem install tiny_tds (not informative at all... due to the fact that it isn't working for me at all.)
- FreeTDS Mac OS X MiniPortile (Not very informative on the approach of miniportile or how to use it...)
- Homebrew / TinyTDS / FreeTDS bundle error (relates to linux, not Mac)
- ROR + Unable to install tiny_tds
- http://talltroym.blogspot.com/2012/04/installing-activerecord-sqlserver.html (a blog entry that gave me false hope)
- https://github.com/rails-sqlserver/tiny_tds/issues/71 (github issue I commented in where I received some advise that I didn't understand well enough to translate into a success story)
- https://github.com/rails-sqlserver/tiny_tds (github for tiny_tds gem)
推荐答案
很遗憾,现在我可以正常使用了,并且不知道我是如何做到的,但是我将列出我所做的所有事情解决这个问题的答案很远.
Well, unfortunately I've now got it working and have NO CLUE how I've done it but I will list all of the things I've done so far in this answer to solve it.
最后,带有标准gem 'tiny_tds', '0.5.1'
的bundle install
最终可以正常工作.
它通过RVM运行Ruby版本1.9.3-p194.
In the end, bundle install
with standard gem 'tiny_tds', '0.5.1'
ended up working fine.
It's running Ruby version 1.9.3-p194 via RVM.
我相当确定这是黄金...
我使用了rvm pkg install iconv
和rvm reinstall 1.9.3 --with-iconv-dir=$rvm_path/usr
This is where the gold is I'm fairly sure...
I used rvm pkg install iconv
and rvm reinstall 1.9.3 --with-iconv-dir=$rvm_path/usr
完成后,我删除了所有旧的gem文件夹... 我切换了bundle的配置路径以匹配新的ruby路径...
Once this completed, I deleted all old gem folders... I switched bundle config path to match the new ruby path...
然后捆绑安装并繁荣.
它也使用iconv 1.13而不是1.14,不确定是否重要.
It's also using iconv 1.13 instead of 1.14 not sure if that matters.
我希望这对任何人都有帮助...对我来说,这绝对是一次巨大的学习经验.
I hope this helps anyone... it's definitely been a huge learning experience for me.
这篇关于无法通过Homebrew FreeTds在Mac OS X 10.8上捆绑安装tiny_tds的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!