Skip to content

Commit ac1ac04

Browse files
author
Nicolas Rodriguez
committed
Fix error : "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'"
travis-ci/travis-ci#6842
1 parent 0c92638 commit ac1ac04

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist: trusty
22
language: ruby
3-
sudo: false
3+
sudo: required
44
cache: bundler
55
rvm:
66
- 2.4.1
@@ -17,6 +17,11 @@ services:
1717
- mysql
1818
addons:
1919
postgresql: '9.6'
20+
apt:
21+
packages:
22+
- mysql-server-5.6
23+
- mysql-client-core-5.6
24+
- mysql-client-5.6
2025
before_script:
2126
- sh -c "if [ '$DB_ADAPTER' = 'mysql2' ]; then mysql -e 'create database ajax_datatables_rails;'; fi"
2227
- sh -c "if [ '$DB_ADAPTER' = 'postgresql' ]; then psql -c 'create database ajax_datatables_rails;' -U postgres; fi"

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
encoding: 'utf8'
6666
}
6767

68-
options = options.merge(username: 'root', host: 'localhost') if adapter == 'mysql2'
69-
options = options.merge(database: 'tmp/test.sqlite3') if adapter == 'sqlite3'
68+
options = options.merge(username: 'root') if adapter == 'mysql2'
69+
options = options.merge(database: ':memory:') if adapter == 'sqlite3'
7070

7171
ActiveRecord::Base.establish_connection(options)
7272

0 commit comments

Comments
 (0)