language: ruby
rvm:
  - 2.1.2
  - ruby-head
matrix:
  allow_failures:
    - rvm: ruby-head
bundler_args: --without development:production
before_script:
  - cp config/database.yml.travis config/database.yml
  - cp sample_config/facebook.yml.sample config/facebook.yml
  - cp sample_config/devise_initializer.rb.sample config/initializers/devise.rb
  - bundle exec rake db:create db:schema:load db:seed
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 10 # give xvfb some time to start
env:
  global:
    - BUNDLE_JOBS=4
    - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
script:
  - "export DISPLAY=:99.0 && bundle exec rspec"

language: ruby
rvm:
  - 2.1.2
  - ruby-head
matrix:
  allow_failures:
    - rvm: ruby-head
bundler_args: --without development:production
before_script:
  - cp config/database.yml.travis config/database.yml
  - cp sample_config/facebook.yml.sample config/facebook.yml
  - cp sample_config/devise_initializer.rb.sample config/initializers/devise.rb
  - bundle exec rake db:create db:schema:load db:seed
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 5 # give xvfb some time to start
env:
  global:
    - BUNDLE_JOBS=4
    - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
script:
  - bundle exec rspec

Decrease wait time and try without exporting display port
Decrease wait time and try without exporting display port
