From eed78751a1d6816cca09a36ec63465cfc1de5e73 Mon Sep 17 00:00:00 2001
From: Abe Voelker <abe@abevoelker.com>
Date: Wed, 10 Jan 2018 20:03:56 -0600
Subject: [PATCH] Fix Travis CI build errors

---
 .travis.yml               | 2 ++
 Gemfile                   | 4 ++--
 Rakefile                  | 4 ++--
 gemfiles/Gemfile.rails3.2 | 4 ++--
 gemfiles/Gemfile.rails4.1 | 4 ++--
 gemfiles/Gemfile.rails5.0 | 2 +-
 6 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index bb325f3f..d8587bf5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,6 +22,8 @@ gemfile:
   - gemfiles/Gemfile.rails3.2
   - gemfiles/Gemfile.rails4.1
   - gemfiles/Gemfile.rails5.0
+before_install:
+  - which bundle >/dev/null 2>&1 || gem install bundler
 matrix:
   exclude:
     - rvm: 1.9.3
diff --git a/Gemfile b/Gemfile
index 128b94fd..b52115ad 100644
--- a/Gemfile
+++ b/Gemfile
@@ -31,14 +31,14 @@ group :test do
   gem 'webmock'
 
   platforms :ruby do
-    gem 'pg'
+    gem 'pg', '~> 0.11'
     gem 'mysql2', '~> 0.3.11'
   end
 
   platforms :jruby do
     gem 'jdbc-mysql'
     gem 'jdbc-sqlite3'
-    gem 'activerecord-jdbcpostgresql-adapter'
+    gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.0'
   end
 end
 
diff --git a/Rakefile b/Rakefile
index c7d10632..83de4cdd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -32,7 +32,7 @@ namespace :db do
 
     desc 'Drop the MySQL test databases'
     task :drop do
-      `mysqladmin --user=#{config['mysql']['username']} -f drop #{config['mysql']['database']}`
+      `mysql --user=#{config['mysql']['username']} -e "DROP DATABASE IF EXISTS #{config['mysql']['database']}"`
     end
   end
 
@@ -44,7 +44,7 @@ namespace :db do
 
     desc 'Drop the PostgreSQL test databases'
     task :drop do
-      `dropdb #{config['postgres']['database']}`
+      `dropdb --if-exists #{config['postgres']['database']}`
     end
   end
 
diff --git a/gemfiles/Gemfile.rails3.2 b/gemfiles/Gemfile.rails3.2
index da838d6a..8eed6ddc 100644
--- a/gemfiles/Gemfile.rails3.2
+++ b/gemfiles/Gemfile.rails3.2
@@ -31,13 +31,13 @@ group :test do
   gem 'webmock'
 
   platforms :ruby do
-    gem 'pg'
+    gem 'pg', '~> 0.11'
     gem 'mysql2', '~> 0.3.11'
   end
 
   platforms :jruby do
     gem 'jdbc-mysql'
     gem 'jdbc-sqlite3'
-    gem 'activerecord-jdbcpostgresql-adapter'
+    gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.0'
   end
 end
diff --git a/gemfiles/Gemfile.rails4.1 b/gemfiles/Gemfile.rails4.1
index 34f96168..b9b0a944 100644
--- a/gemfiles/Gemfile.rails4.1
+++ b/gemfiles/Gemfile.rails4.1
@@ -31,13 +31,13 @@ group :test do
   gem 'webmock'
 
   platforms :ruby do
-    gem 'pg'
+    gem 'pg', '~> 0.11'
     gem 'mysql2', '~> 0.3.11'
   end
 
   platforms :jruby do
     gem 'jdbc-mysql'
     gem 'jdbc-sqlite3'
-    gem 'activerecord-jdbcpostgresql-adapter'
+    gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.0'
   end
 end
diff --git a/gemfiles/Gemfile.rails5.0 b/gemfiles/Gemfile.rails5.0
index 07a4aaa8..21370903 100644
--- a/gemfiles/Gemfile.rails5.0
+++ b/gemfiles/Gemfile.rails5.0
@@ -31,7 +31,7 @@ group :test do
   gem 'webmock'
 
   platforms :ruby do
-    gem 'pg'
+    gem 'pg', '~> 0.18'
     gem 'mysql2', '~> 0.3.11'
   end
 
-- 
GitLab