2013-02-21 111 views
12

我的問題
什麼是一些surefire步驟,我可以採取100%得到這個工作? 我需要真正的指導,而不是一個班輪答案或對這個過程的模糊的概念性描述。未能在Mac OS X 10.8上安裝tiny_tds與自制軟件FreeTds

讓我們來看看這個。 這似乎是有衝突的地方,我已經得到了GitHub的寶石開發人員的幫助,涉及到我對Ruby/Rails/Bundler/Homebrew的經驗,所以它不完全是他們的錯:P 但我需要弄清楚如何儘快完成這項工作,以便解決我目前遇到的這個問題。


更新:2013年2月25日
更新GCC/XCODE 4.6版(4H127)和XCODE命令行工具 的下載最新版本的,現在iconv_open子()是顯示在extconf檢查了。 現在我得到這些錯誤:

我相信他們現在問題與tiny_tds和兼容性與最新的xcode路徑。

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:2013年2月25日
OKAY,所以我重新安裝一切,紅寶石/軌道/等 而從評論者使用的一些建議,用 「:路徑=>」 和這裏是我的輸出現在當我運行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)像任何其他初始簡易安裝說明...

$ 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

$ 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)虛成功/僞造它直到你讓它/ A BIG放下/高級設置說明
發現這個博客條目... http://talltroym.blogspot.com/2012/04/installing-activerecord-sqlserver.html

然後我找到了正確的路徑到libiconv庫和freetds庫。再次

$ 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... 

嘗試bundle_install和衝擊......但它仍然不是通過在Gemfile中gem 'tiny_tds'安裝...

所以我從Gemfile中刪除tiny_tds並繼續: 接下來,我跑它像這樣啓動服務器最多反正... 和預期的一樣......

$ 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

$ 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. 

其他相關問題和資源

+0

我有一個非常類似的問題,下面的鏈接解決了它 – 2013-02-25 16:17:22

+1

您是否想要附加鏈接? – 2013-02-25 16:18:15

+0

對不起,意識到它不會幫助你,你已經完成了鏈接。 – 2013-02-25 16:19:57

回答

3

那麼,不幸的是,我現在已經得到它的工作,並沒有CLUE如何做到這一點,但我會列出迄今爲止在這個答案解決它所做的所有事情。

最後,bundle install與標準gem 'tiny_tds', '0.5.1'結束了工作正常。 它通過RVM運行Ruby 1.9.3-p194版本。

這就是黃金是我相當肯定...
我用rvm pkg install iconvrvm reinstall 1.9.3 --with-iconv-dir=$rvm_path/usr

一旦完成,我刪除了所有舊的寶石文件夾... 我打開包的配置路徑以匹配新的紅寶石路徑...

然後確實捆綁安裝,並繁榮。

它也使用iconv 1.13而不是1.14不知道是否重要。

我希望這可以幫助任何人...這絕對是一個巨大的學習經驗對我來說。

4

首先安裝free_tds並需要依賴關係。

這個工作對我來說,你的路可能會有所不同

gem install tiny_tds -- --with-freetds-include=/usr/local/include 
--with-freetds-lib=/usr/local/lib 
--with-iconv-include=/usr/local/Cellar/libiconv/1.14/include 
--with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib 
+0

當然,你也可以重新安裝紅寶石1.9.3並指定iconv-dir,但我的解決方案更快一些。 – 2013-03-01 19:16:28

0

我不知道很多關於Ruby。只是涉獵了一下。您始終可以直接安裝vertx,而不是我認爲您可以更好地控制目錄位置,並且可以更輕鬆地進行升級。我爲Ops團隊編寫了一本生產指南(真的是一項進展中的工作)。它可能會幫助你。它可能不會。

我寫了一個安裝指南。我計劃加入一些調整,以它如何配置TCP/IP堆棧和Vertx規模(臨時端口設置,文件描述符限制,負載測試,調整循環緩衝區等)

http://rick-hightower.blogspot.com/2013/11/installing-vertx-on-ubuntu-13.html

安裝Vertx在Ubuntu 13

環境的詳細信息

實例類型:EC2 hi1.4xlarge

  • 操作系統:Ubuntu的13.10(64位)的Java虛擬機:

  • Java版本 「1.7.0_25」(2.3.12的IcedTea)(建23.7-B01)

  • vertx:2.1M1(建2013年10月29日十一時11分22秒)

安裝軟件

的Java JDK 7:

$ sudo apt-get install openjdk-7-jdk 

Vertx

下載Vertx

$ wget http://dl.bintray.com/vertx/downloads/vert.x-2.1M1.tar.gz 
$ tar -zxf vert.x-2.1M1.tar.gz 
$ ls 
vert.x-2.1M1 vert.x-2.1M1.tar.gz 

進入標準的Unix結構:

$ sudo mv vert.x-2.1M1 /usr/local/share/ 
$ ls /usr/local/share/ 
    ... vert.x-2.1M1 xml 

創建符號鏈接到/ usr /本地/ SHA重新/ vertx所以升級更容易。

$ sudo ln -s /usr/local/share/vert.x-2.1M1/ /usr/local/share/vertx 
$ ls /usr/local/share/vertx 
api-docs bin client conf lib 

將vertx符號鏈接添加到/ usr/bin /目錄。

$ sudo ln -s /usr/local/share/vertx/bin/vertx /usr/bin/vertx 

安裝一個真正該死編輯:

$ sudo apt-get install emacs 

創建測試腳本來測試vertx正確安裝:

var vertx = require('vertx'); 
vertx.createHttpServer().requestHandler(function(r) { 
r.response.end("test 1\n");}).listen(8080); 

現在對測試腳本vertx運行:

$ vertx run test.js & 
[1] 11493 
$ Succeeded in deploying verticle 

現在測試安裝l所有工作:

$ curl 127.0.0.1:8080 
test 1 

如果您得到「測試1」,這意味着vertx是安裝並能夠服務器垂直。

後來我打算添加init.d腳本來啓動vertx,並且可能會喚醒一個進程並確保每分鐘都在運行。我還計劃使用NGINX反向代理向前幾個vertex實例,以便每個盒子可以處理接近1,000,000個請求並具有更多的DOS保護。反正...進展中的工作...

12

該做的工作,我(2014年10月2日/ OSX 10.9.5):

brew install freetds 

和軌道:

gem 'tiny_tds' 
bundle install 
+0

這對我有用。謝謝@andorov – 2015-11-05 08:06:31

+0

在macOS 10.13上需要這個。這工作很好。謝謝! – JHawkZZ 2018-02-06 17:32:29

0

什麼工作對我來說是上述mr.ruh.roh創業板建設方案,轉載這裏:在一行

gem install tiny_tds -- --with-freetds-include=/usr/local/include 
    --with-freetds-lib=/usr/local/lib 
    --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include 
    --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib 

。該寶石安裝安裝寶石,但捆綁仍然失敗,即使寶石已經建成並安裝。然而,爲bundler添加這些選項已奏效。

bundle config build.tiny_tds -- --with-freetds-include=/usr/local/include 
    --with-freetds-lib=/usr/local/lib 
    --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include 
    --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib 

再次,在一行中。使用該捆綁器配置集,bundle install工作。

請注意,我已經運行:

brew install freetds 
brew install libiconv 

這爲我工作於2015年2月20日在OS X 10.9.5和Xcode 6.1.1安裝

1

我有解決它:

brew install freetds 

然後

bundle install