无法推送应用程序Heroku - 无法通过Bundler安装tiny_tds

时间:2014-07-24 06:35:14

标签: ruby git heroku sinatra tiny-tds

这就是看我的Gemfile的方式:

source :rubygems
gem 'sinatra'
gem 'json'
gem 'tiny_tds'

将应用程序推送到Heroku的输出:

-----> Ruby app detected
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       The source :rubygems is deprecated because HTTP requests are insecure.
       Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
       Fetching gem metadata from http://rubygems.org/..........
       Fetching additional metadata from http://rubygems.org/..
       Installing rack 1.5.2
       Using bundler 1.6.3
       Installing sinatra 1.0
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/ruby-2.0.0/bin/ruby extconf.rb
       checking for iconv_open() in iconv.h... yes
       checking for sybfront.h... no
       -----
       freetds 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=/tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/ruby-2.0.0/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}/
       --with-freetds-dir
       --without-freetds-dir
       --with-freetds-include
       --without-freetds-include=${freetds-dir}/include
       --with-freetds-lib
       --without-freetds-lib=${freetds-dir}/
       Gem files will remain installed in /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/bundle/ruby/2.0.0/gems/tiny_tds-0.6.2 for inspection.
       Results logged to /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/bundle/ruby/2.0.0/gems/tiny_tds-0.6.2/ext/tiny_tds/gem_make.out
       Installing json 1.8.1
       An error occurred while installing tiny_tds (0.6.2), and Bundler cannot
       continue.
       Make sure that `gem install tiny_tds -v '0.6.2'` succeeds before bundling.
       Bundler Output: The source :rubygems is deprecated because HTTP requests are insecure.
       Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
       Fetching gem metadata from http://rubygems.org/..........
       Fetching additional metadata from http://rubygems.org/..
       Installing rack 1.5.2
       Using bundler 1.6.3
       Installing sinatra 1.0

       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

       /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/ruby-2.0.0/bin/ruby extconf.rb
       checking for iconv_open() in iconv.h... yes
       checking for sybfront.h... no
       -----
       freetds 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=/tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/ruby-2.0.0/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}/
       --with-freetds-dir
       --without-freetds-dir
       --with-freetds-include
       --without-freetds-include=${freetds-dir}/include
       --with-freetds-lib
       --without-freetds-lib=${freetds-dir}/

       Gem files will remain installed in /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/bundle/ruby/2.0.0/gems/tiny_tds-0.6.2 for inspection.
       Results logged to /tmp/build_57173bf8-9a1a-4b28-8b51-57ba286f69b3/vendor/bundle/ruby/2.0.0/gems/tiny_tds-0.6.2/ext/tiny_tds/gem_make.out
       Installing json 1.8.1
       An error occurred while installing tiny_tds (0.6.2), and Bundler cannot
       continue.
       Make sure that `gem install tiny_tds -v '0.6.2'` succeeds before bundling.
 !     Failed to install gems via Bundler.
我的localhost上的

运行完美。我尝试删除存储库并创建一个新的,或重新启动heroku。我如何在heroku上安装tiny_tds?怎么了?

编辑25 / jul / 14

发生此错误是因为您的dyno缺少freetds库。 使用这样的库需要使用自定义buildpack。互联网上有很多开源构建包。例如https://github.com/firmhouse/heroku-buildpack-ruby-freetds

tnx to Damien(Heroku Support)

1 个答案:

答案 0 :(得分:0)

我猜你已经使用C构建交换机在本地计算机上安装了TinyTDS gem,但未通过Bundler指定。您是否在本地主机上沙箱安装?例如

bundle install --binstubs --path=vendor

看看是否有效。我猜它应该失败,因为现在无法访问项目之外的其他宝石。然后使用bundle config使用the build switches suggested in the TinyTDS README

安装FreeTDS