2013-02-21 13 views
12

meine Frage
Was sind einige todsichere Schritte, die ich zu 100% dieses Arbeits nehmen können? Ich würde echte Anweisungen brauchen, keine Liner-Antworten oder vage konzeptionelle Beschreibungen des Prozesses.Failing zu bündeln installieren tiny_tds auf Mac OS X 10.8 mit Homebrew freetds

Lassen Sie uns auf den Grund gehen. Irgendwo scheint es Konflikte zu geben, und ich hatte vom Edelsteinentwickler auf GitHub in Bezug auf meine Erfahrung mit Ruby/Rails/Bundler/Homebrew unterdurchschnittliche Unterstützung, so dass es nicht komplett ihre Schuld ist: P Aber ich muss herausfinden Wie man das so schnell wie möglich funktioniert, geht hier mit meinem derzeitigen Stand dieses Problems.


UPDATE: 2/25/2013
Aktualisiert GCC/XCODE Version 4.6 (4H127) und heruntergeladen neueste Version von XCODE Kommandozeilen-Tools und jetzt iconv_open() in der extconf Checker zeigt nach oben . Jetzt bekomme ich diese Fehler:

Ich glaube, sie sind jetzt Probleme mit tiny_tds und Kompatibilität mit den neuesten xcode-Pfade.

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` 

UPDATE 2: 2/25/2013
OKAY, so dass ich alles neu installiert, Rubin/Rails/usw. Und verwendet ein paar Ratschläge von einem Kommentator zu verwenden ": path =>" und hier ist jetzt mein Ausgang, wenn ich 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' 

Dinge laufen habe ich versucht,

1.) Die ersten EASY Installationsanweisungen wie jedes andere ...

$ rails new test_app 
$ cd test_app 

Nun fügen Sie diese Zeilen Gemfile

gem 'tiny_tds' 
gem 'activerecord-sqlserver-adapter' 

Jetzt Befehle weiter ...

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

AUSGABE 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.) IMAGINARY ERFOLG/FAKE IT TIL SIE ES MACHEN/A BIG LET DOWN/ADVANCED SETUP ANLEITUNG
Fand dieses Blog-Eintrag ... http://talltroym.blogspot.com/2012/04/installing-activerecord-sqlserver.html

Ich habe dann meine korrekten Pfade zu der Libiconv-Bibliothek und der Freedds-Bibliothek gefunden. Als nächstes Ich lief es so:

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

Versuchte bundle_install wieder und Schock ... es ist immer noch nicht über gem 'tiny_tds' in Gemfile Installation ...

So entferne ich tiny_tds von Gemfile und gehen beginnen sowieso Sie den Server ... Und wie erwartet ...

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

andere Fragen UND RESSOURCEN

+0

Ich hatte ein sehr ähnliches Problem und der Link unten löste es –

+1

Meinen Sie, einen Link anzuhängen? –

+0

Sorry, merkte, dass es dir nicht helfen würde, du hast bereits getan, was in dem Link steht. –

Antwort

3

Nun, leider habe ich jetzt funktioniert und habe keinen Hinweis, wie ich es getan habe, aber ich werde alle die Dinge auflisten, die ich bisher in dieser Antwort getan habe, um es zu lösen.

Am Ende funktionierte bundle install mit Standard gem 'tiny_tds', '0.5.1' gut. Es läuft Ruby Version 1.9.3-p194 über RVM.

Dies ist, wo das Gold Ich bin ziemlich sicher ist ...
I verwendet rvm pkg install iconv und rvm reinstall 1.9.3 --with-iconv-dir=$rvm_path/usr

Sobald dies abgeschlossen ist, löschte ich alle alten Juwel Ordner ... I Bündel Konfigurationspfad geschaltet um den neuen Rubinpfad zu entsprechen ...

Dann tat Bündel installieren und Boom.

Es ist auch mit iconv 1.13 statt 1.14 nicht sicher, ob das wichtig ist.

Ich hoffe, das hilft jedem ... es war definitiv eine große Lernerfahrung für mich.

4

Zuerst installieren Sie free_tds und erforderliche Abhängigkeiten.

Das ist für mich gearbeitet, kann Ihre Wege

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

Natürlich könntest du auch Ruby 1.9.3 neu installieren und iconv-dir angeben, aber meine Lösung ist ein bisschen schneller. –

0

unterschiedlich sein, weiß ich nicht viel über Rubin. Ich habe mich nur ein bisschen versucht. Sie können vertx immer direkt installieren, da Sie mehr Kontrolle über den Speicherort des Verzeichnisses haben und es einfacher zu aktualisieren ist. Ich habe einen Leitfaden für das Ops-Team für die Produktion geschrieben (ein work in progress). Es könnte dir helfen. Es könnte nicht sein.

Ich schrieb ein wenig Installationsanleitung. Ich plane, einige Optimierungen, um es auf das Hinzufügen, wie TCP/IP-Stack zu konfigurieren und Vertx (ephemeren Port-Einstellungen, Grenzen Dateideskriptor, Lasttests, Tuning recycle Puffer, etc.) zu skalieren

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

Installieren Vertx auf Ubuntu 13

Umwelt Details

Instanz Typ: EC2 hi1.4xlarge

  • OS: Ubuntu 13.10 (64 Bit) Java VM:

  • java version "1.7.0_25" (IcedTea 2.3.12) (Build 23.7-b01)

  • VertX: 2.1M1 (gebaut 2013-10-29 11:11:22)

Installation der Software

Java 7 JDK:

$ sudo apt-get install openjdk-7-jdk 

Vertx:

Herunterladen 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 

Umzug in Standardstruktur Unix:

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

Erstellen symbolischer Link auf/usr/local/sha re/vertx, so ist die Aktualisierung einfacher.

$ 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 

Fügen Sie vertx symbolische Verknüpfung zu Ihrem Verzeichnis/usr/bin/hinzu.

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

Installieren Sie einen echten verdammt Editor:

$ sudo apt-get install emacs 

Testskript erstellen VertX zu testen ordnungsgemäß installiert ist:

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

Jetzt VertX gegen Testskript auszuführen:

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

Jetzt testen, dass die Installation l hat alles funktioniert:

$ curl 127.0.0.1:8080 
test 1 

Wenn Sie "Test 1" erhalten, bedeutet das, dass vertx installiert ist und Server verticles kann.

Später werde ich init.d-Skripte hinzufügen, um vertex zu starten und vielleicht einen Prozess, der aufwacht und sicherstellt, dass alles ungefähr jede Minute läuft. Ich plane auch, ein paar Vertex-Instanzen mit NGINX-Reverse-Proxy zu konfrontieren, so dass jede Box fast 1.000.000 Anfragen bearbeiten kann und ein bisschen mehr DOS-Schutz hat. Wie auch immer ... ein work in progress ...

12

Das ist für mich funktioniert hat (2. Oktober 2014/OSX 10.9.5):

brew install freetds 

und in Schienen:

gem 'tiny_tds' 
bundle install 
+0

Das hat für mich funktioniert. Danke @andorov –

+0

Benötigt dies auf macOS 10.13. Das hat wunderbar funktioniert. Vielen Dank! – JHawkZZ

0

Was arbeitete für mich war mr.ruh.roh's edelsteinbauoptionen oben, reproduziert hier:

in einer linie. Dieses Juwel installiert das Juwel, aber das Bündel ist immer noch fehlgeschlagen, obwohl das Juwel gebaut und installiert wurde. Das Hinzufügen dieser Optionen für Bundler funktionierte jedoch.

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 

Wieder in einer Zeile. Mit dieser Bundler-Konfiguration wurde bundle install bearbeitet.

Bitte beachte, dass ich schon laufen:

brew install freetds 
brew install libiconv 

Dieses am 20. Februar für mich gearbeitet, 2015 auf OS X 10.9.5 mit Xcode 6.1.1

1

installiert ich gelöst habe es mit:

brew install freetds 

und dann

bundle install