fluent-plugin-sql
fluent-plugin-sql copied to clipboard
Could not load 'active_record/connection_adapters/postgresql_adapter when using docker image fluent/fluentd:v1.3-debian-onbuild
Dockerfile: `FROM fluent/fluentd:v1.3-debian-onbuild
RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev libpq-dev"
&& apt-get update
&& apt-get install -y --no-install-recommends $buildDeps
&& sudo gem install
fluent-plugin-sql --no-document
&& sudo gem install
pg -v 0.21.0 --no-document
&& sudo gem install
fluent-plugin-remote_syslog --no-document \
&& sudo gem sources --clear-all
&& SUDO_FORCE_REMOVE=yes
apt-get purge -y --auto-remove
-o APT::AutoRemove::RecommendsImportant=false
$buildDeps
&& rm -rf /var/lib/apt/lists/*
/home/fluent/.gem/ruby/2.3.0/cache/*.gem`
Error:
2018-12-05 09:20:11 +0000 [error]: #0 Could not load 'active_record/connection_adapters/postgresql_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. path=nil error_class=LoadError error="Could not load 'active_record/connection_adapters/postgresql_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."
How about install latest pg, not 0.21.0
?
Hi, Not the OP but same issues, using fluent/fluentd:stable (fluentd v1.3.2 right now). It is based on Alpine not debian
FROM fluent/fluentd:stable
RUN apk add --no-cache --update --virtual .build-deps postgresql-dev \
sudo build-base ruby-dev \
&& sudo fluent-gem install fluent-plugin-sql \
&& sudo fluent-gem install pg --no-document \
&& sudo fluent-gem install fluent-plugin-kubernetes_metadata_filter \
&& sudo gem sources --clear-all \
&& apk del .build-deps postgresql-dev \
&& rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem
Ruby version is 2.5.2
And I get the exact same error as OP, it probably has to do with version mismatch I guess. I will try more versions and update the issue when I found something that fits my needs :)
@oranmoshai seems you removed libpq-dev