2017-10-13 34 views
0

我试图使用泊坞窗使一个正方体的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 

我只是运行一个单一端点的小西纳特拉应用,在那里你发送的图像的返回文本作为一个JSON文件和IM在这一点绊脚石。

我已经搜索了相当数量的数据,并尝试了一些解决方案,比如指向配置文件的位置,但它们似乎都出现了类似的错误。

任何帮助都会很好

+0

错误消息提示可以在/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/找到答案do_postgres-0.10.17/mkmf.log。你应该发布该文件的内容。我的猜测是你缺少一些必要的构建组件;图书馆,工具,标题,那种东西。答案将在构建日志中。 – Casper

+0

所以当我试图打开这个文件时,我得到了它不存在的回应 – Wrumble

回答

0

为什么要使用ubuntu:16.04在所有的第一位。我认为问题在于你的docker环境没有正确设置来运行ruby和bundler。

要想超越这个血腥的设置过程,我建议您在存储空间有问题的情况下使用带有高山或超薄标签的红宝石图像。然后,安装过程变得更容易,并避免所有这些错误