0
私はドッキングウィンドウを使用したTesseract APIを作るしようとしていますが、バンドルの時点でインストールするときに、私はこのエラーを取得:カントはシナトラルビー/とのドッキングウィンドウ上のpostgresをインストール
Fetching data_mapper 1.2.0
Installing data_mapper 1.2.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/var/lib/gems/2.3.0/gems/do_postgres-0.10.17/ext/do_postgres
/usr/bin/ruby2.3 -r ./siteconf20171013-5-6l2bdy.rb extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/lib
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/lib
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not
created
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/do_postgres-0.10.17/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/do_postgres-0.10.17
for inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/do_postgres-0.10.17/gem_make.out
An error occurred while installing do_postgres (0.10.17), and Bundler cannot
continue.
Make sure that `gem install do_postgres -v '0.10.17'` succeeds before bundling.
In Gemfile:
dm-postgres-adapter was resolved to 1.2.0, which depends on
do_postgres
The command '/bin/sh -c /bin/bash -l -c "bundle install"' returned a non-zero code: 5
マイドッカファイルは次のようになります。
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
ruby-dev \
postgresql postgresql-contrib libpq-dev \
autoconf \
autoconf-archive \
automake \
build-essential \
checkinstall \
cmake \
g++ \
git \
libcairo2-dev \
libcairo2-dev \
libicu-dev \
libicu-dev \
libjpeg8-dev \
libjpeg8-dev \
libpango1.0-dev \
libpango1.0-dev \
libpng12-dev \
libpng12-dev \
libtiff5-dev \
libtiff5-dev \
libtool \
pkg-config \
wget \
xzgv \
zlib1g-dev \
vim \
python-pip
# SSH for diagnostic
RUN apt-get update && apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed '[email protected]\s*required\s*[email protected] optional [email protected]' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
# Directories
ENV SCRIPTS_DIR /home/scripts
ENV PKG_DIR /home/pkg
ENV BASE_DIR /home/workspace
ENV LEP_REPO_URL https://github.com/DanBloomberg/leptonica.git
ENV LEP_SRC_DIR ${BASE_DIR}/leptonica
ENV TES_REPO_URL https://github.com/tesseract-ocr/tesseract.git
ENV TES_SRC_DIR ${BASE_DIR}/tesseract
ENV TESSDATA_PREFIX /usr/local/share/tessdata
RUN mkdir ${SCRIPTS_DIR}
RUN mkdir ${PKG_DIR}
RUN mkdir ${BASE_DIR}
RUN mkdir ${TESSDATA_PREFIX}
COPY ./container-scripts/* ${SCRIPTS_DIR}/
RUN chmod +x ${SCRIPTS_DIR}/*
RUN ${SCRIPTS_DIR}/repos_clone.sh
RUN ${SCRIPTS_DIR}/tessdata_download.sh
# Install pytesseract
RUN pip install --upgrade pip \
&& pip install pytesseract==0.1.6
# Add textcleaner from Fred's ImageMagick Scripts
# http://www.fmwconcepts.com/imagemagick/textcleaner/
ADD ./bin/textcleaner /usr/local/bin
# Setup app
WORKDIR /app
ADD . /app
RUN /bin/bash -l -c "gem install pg -- --with-pg-lib=/usr/lib"
RUN /bin/bash -l -c "gem install bundler"
RUN /bin/bash -l -c "bundle install"
ENTRYPOINT ["ruby", "app.rb"]
# create user tesseract for use with this server
RUN groupadd -r tesseract && useradd -r -g tesseract tesseract
USER tesseract
私はちょうどあなたが画像を送信する単一のエンドポイントを持つ小さなシナトラアプリを実行していANそれは、この時点でつまずきJSONファイルとイムなどのテキストを返します。
私はかなりの量を捜して、設定ファイルがどこに向いているかなどのいくつかの解決策を試しましたが、すべて同様のエラーが出るようです。
助けがあれば助かります
エラーメッセージは、答えが/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/にあることを示唆しています。 do_postgres-0.10.17/mkmf.log。そのファイルの内容を投稿する必要があります。私の推測では、いくつかの不可欠なビルドコンポーネントが欠けているということです。ライブラリ、ツール、ヘッダ、そのようなもの。答えはビルドログにあります。 – Casper
私はこのファイルを開こうとしたとき、私はそれが存在しなかったという応答を得た – Wrumble