I have a sinatra rack ruby app that I want to deploy on heroku. The app needs to connect to an SQL Server Database. For that I need the TinyTds gem.
Gemfile
source 'http://rubygems.org'
ruby "1.9.3"
gem 'sinatra'
gem 'tiny_tds'
Gemfile.lock after bundle install
GEM
remote: http://rubygems.org/
specs:
rack (1.6.0)
rack-protection (1.5.3)
rack
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
tilt (1.4.1)
tiny_tds (0.6.2)
PLATFORMS
ruby
DEPENDENCIES
sinatra
tiny_tds
TinyTds requires FreeTDS which heroku doesn't have apparently. So there are some crazy solutions on the internet with static compiles in heroku-similar VMs and stuff like that. The most reasonable solution was to set a custom buildpack for my app that includes FreeTDS:
heroku create my_new_app --buildpack https://github.com/firmhouse/heroku-buildpack-ruby-freetds.git
However
$ git push heroku master
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Ruby/Rack app detected
remote: Installing freetds into /tmp/build_7b7e059c43475a97d6c091bcf9162e16/vendor/freetds
remote:
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote: 100 3590k 100 3590k 0 0 17.8M 0 --:--:-- --:--:-- --:--:-- 17.8M
remote:
remote: -----> Using Ruby version: ruby-1.9.3
remote: -----> Installing dependencies using Bundler version 1.7.12
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
remote: Could not load OpenSSL.
remote: You must recompile Ruby with OpenSSL support or change the sources in your
remote: Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
remote: RVM are available at http://rvm.io/packages/openssl.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby/Rack app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to my_new_app.
remote:
To https://git.heroku.com/my_new_app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/my_new_app.git'
Edit: My question is how do I get heroku to work with tiny_tds.