LoadError: Could not load 'active_record/connection_adapters/mysql2_adapter'

HI, im getting the error below during a cap deploy. i can run production console successfully on the server.

any ideas?

thx

EBUG [04b3530e] Command: cd /rorapps/myapp/production/myapp_com/releases/20170626144940 && ~/.rvm/bin/rvm ruby-2.3.1@myapp_gemset do bundle install --path /rorapps/myapp/production/myapp_co m/shared/bundle --without development test --deployment --quiet

INFO [04b3530e] Finished in 11.265 seconds with exit status 0 (successful).

DEBUG [c63173da] Running if test ! -d /rorapps/myapp/production/myapp_com/releases/20170626144940; then echo “Directory does not exist ‘/rorapps/myapp/production/myapp_com/releases/2017062614 4940’” 1>&2; false; fi as railsuser@myip

DEBUG [c63173da] Command: if test ! -d /rorapps/myapp/production/myapp_com/releases/20170626144940; then echo “Directory does not exist ‘/rorapps/myapp/production/myapp_com/releases/201706261 44940’” 1>&2; false; fi

DEBUG [c63173da] Finished in 0.029 seconds with exit status 0 (successful).

INFO [24759d1b] Running ~/.rvm/bin/rvm ruby-2.3.1@myapp_gemset do bundle exec rake assets:precompile as railsuser@myip

DEBUG [24759d1b] Command: cd /rorapps/myapp/production/myapp_com/releases/20170626144940 && ( export RAILS_ENV=“production” RAILS_GROUPS="" ; ~/.rvm/bin/rvm ruby-2.3.1@myapp_gemset do bundle e xec rake assets:precompile )

DEBUG [24759d1b] rake aborted!

DEBUG [24759d1b] LoadError: Could not load ‘active_record/connection_adapters/mysql2_adapter’. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than ’ mysql’, ‘mysql2’, ‘postgresql’ or ‘sqlite3’ add the necessary adapter gem to the Gemfile.

DEBUG [24759d1b] /rorapps/myapp/production/myapp_com/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require’

Have you tried running assets:precompile locally, in production environment?

What have you got in database.yml? Also post Gemfile please.

Colin

i did change from mysql to mariadb (debian 7 upgrade to 8).

just did this too:

gem install mysql2 -- --with-mysql-config=/usr/bin/mariadb_config
but no go....

db.yml

MySQL. Versions 5.0+ are recommended.

pty true false doesnt make a difference…

You didn't answer my other question, what happens if you run locally
RAILS_ENV=production bundle exec rake assets:precompile

Also I notice you have
gem 'mysql2'# , '~> 0.3.18'
Why have you commented out the version requirement? I think it may be
required for rails 4.2

Colin

bot commands succeed

i even can run

rails c production without issue…

clueless

bot commands succeed

Which both commands?

Colin

local:
precompiling assets locally - OK
reverting back to mysql verison:

gem ‘mysql2’ , ‘~> 0.3.20’

server:

rails c production - OK

local:
precompiling assets locally - OK
reverting back to mysql verison:
gem 'mysql2' , '~> 0.3.20'

server:
rails c production - OK

I am clueless too then, sorry. Hopefully someone else will have an idea.

Colin

On the server, try:

cd /rorapps/myapp/production/myapp_com/current

``

~/.rvm/bin/rvm use 2.3.1@myapp_gemset

``

gem install mysql2 – --with-mysql-config=/usr/bin/mariadb_config

``

i did that too, and reverted back; no go…

meanwhile i have trashed the image and recreated everything…

thx everyone