2

So I'm running rspec tests with jruby-1.7.16.1 after completing a bundle install, and they are all failing to the same error:

     Failure/Error: Unable to find arjdbc/jdbc/RubyJdbcConnection.java to read failed line

 ActiveRecord::JDBCError:
   com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
 # arjdbc/jdbc/RubyJdbcConnection.java:453:in `init_connection'

Occasionally I would get an error like this when I'd forget to start mysql server, but I ensured it was running. The GemFile is as such

    source 'http://rubygems.org'

gem 'rails', '3.2.8'
gem 'rubyzip', '0.9.9'
gem 'roo','1.12.1'
gem 'jdbc-mysql', '5.1.33', platform: :jruby
gem 'activerecord-jdbcmysql-adapter', '1.3.12', platform: :jruby
gem 'jquery-rails', '2.1.2'

gem 'haml', '3.1.7'
gem 'puma', '2.9.2'

gem 'devise', '2.1.2'
gem 'devise-async', '0.5.0'
gem 'cancan', '1.6.8'
gem 'simple_form', '2.0.4'
gem 'cocoon', '1.1.1'
gem 'inherited_resources', '1.3.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'mechanize', '2.5.1'
gem 'delayed_job', '3.0.4'
gem 'paperclip', '3.4.0'
gem 'spreadsheet', '0.6.4.1'
gem 'geocoder', '1.1.6'
gem 'whenever', '0.8.2'
gem 'american_date', '1.0.0'
gem 'money','5.1.1'
gem 'rets', '0.11.0'
gem 'haversine','0.3.0'

gem 'celluloid','0.15.2'
gem 'sinatra', '1.4.6'
source "https://9789474f:e71b0546@gems.contribsys.com/" do
  gem 'sidekiq-pro','1.9.2'
end
gem 'redis','3.2.1'
gem 'remote_lock','1.1.0'
gem 'sidekiq-limit_fetch','2.3.0'

group :assets do
  gem 'stylus', '0.7.1'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.3.0'
end

group :development do
  gem 'net-ssh', '2.9.4'
  gem 'capistrano', '3.4.1'
  gem 'capistrano-rails', '1.3.0'
  gem 'capistrano-rvm', '0.1.2'
end

group :development, :test do
  gem 'dotenv-rails', '2.2.1'
  gem 'rspec-rails', '~> 3.5'
  gem 'fantaskspec'
end

group :test do
  gem 'factory_girl_rails', '~> 4.0'
  gem 'fantaskspec'
  gem 'vcr'
  gem 'fakeweb'
end

gem 'rest-client', '1.8.0'
gem 'poltergeist', '1.8.1'
gem 'nokogiri', '1.5.11'
gem 'zip-codes', '0.2.1'

gem 'elasticsearch-model', '0.1.9'
gem 'elasticsearch-rails', '0.1.9'
gem "fog", '1.38.0'
gem 'newrelic_rpm', '3.18.1.330'
gem 'sidekiq-scheduler', '2.1.7'
gem 'aws-sdk', '2.10.28'
gem 'StreetAddress', '1.0.6'

If there is more information required I'd be happy to provide it, let me know if anyone has run into this.

The odd thing is, these spec tests used to work fine prior to a merge I did with our repository. The other dev doesn't seem to be running into this same issue, so I can only assume the Gemfiles are all correct and that my environment is the issue.

Sean Raia
  • 23
  • 4

1 Answers1

0
  1. Make sure the database is up and running.
  2. Does the user that's trying to connect to the database has permission to connect? Try logging in with that user in the client software. Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server
  3. Try creating a new user with admin privileges and try connecting.

Advice: Try using a software that keeps your development environments in sync, and test it well. We use Vagrant to reproduce development environments.

zakir8
  • 1
  • 1