I looked into this a while ago in order to allow importing phpBB3 from a SQL Server database. This worked for me:
./launcher enter app
apt-get install freetds-dev
echo "gem 'tiny_tds'" >> Gemfile
su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'
What’s the error message in case this doesn’t work anymore?