Ruby on rails Ubuntu-无法安装RMagick

Ruby on rails Ubuntu-无法安装RMagick,ruby-on-rails,ruby,ubuntu,rmagick,Ruby On Rails,Ruby,Ubuntu,Rmagick,如何将RMagick gem安装到Ubuntu?我在这里找到了一些线程,其中一些直接指向Ubuntu系统上的安装,但没有一个适合我 这是我运行sudo gem install rmagick时得到的输出 Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension.

如何将RMagick gem安装到Ubuntu?我在这里找到了一些线程,其中一些直接指向Ubuntu系统上的安装,但没有一个适合我

这是我运行sudo gem install rmagick时得到的输出

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /opt/bitnami/ruby/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes

Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
         /opt/bitnami/common/bin/Magick-config reports version 6.7.5 Q16 is installed in /opt/bitnami/common
         /usr/bin/Magick-config reports version 6.6.9 Q16 is installed in /usr
Using 6.7.5 Q16 from /opt/bitnami/common.

checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.2. Can't find MagickWand.h.
*** 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=/opt/bitnami/ruby/bin/ruby


Gem files will remain installed in /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
Results logged to /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
它在AmazonEC2服务器上。 如果我尝试运行gem install rmagick,我会

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /opt/bitnami/ruby/lib/ruby/gems/1.9.1 directory.
你能帮我解决这个问题吗

多谢各位

编辑:我尝试的内容:

  • sudo apt get安装libmagickwand dev

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libmagickwand-dev is already the newest version.
    The following packages were automatically installed and are no longer required:
      libgraphicsmagick3 libmagick++4 libgraphicsmagick++3 libgraphicsmagick1-dev
      libgraphics-magick-perl libperl5.14 libgraphicsmagick++1-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
    
  • sudo apt get安装libmagickwand dev imagemagick

    正在阅读软件包列表。。。多恩 构建依赖树 正在读取状态信息。。。多恩 imagemagick已经是最新版本了。 libmagickwand dev已经是最新版本了。 以下软件包已自动安装,不再需要: libgraphicsmagick3 libmagick++4 libgraphicsmagick++3 libgraphicsmagick1开发 libgraphics magick perl libperl5.14 libgraphics magick++1-dev 使用“apt get autoremove”删除它们。 已升级0,新安装0,要删除0,未升级40

  • apt get安装libmagickwand dev

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libmagickwand-dev is already the newest version.
    The following packages were automatically installed and are no longer required:
      libgraphicsmagick3 libmagick++4 libgraphicsmagick++3 libgraphicsmagick1-dev
      libgraphics-magick-perl libperl5.14 libgraphicsmagick++1-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
    
    E:无法打开锁文件/var/lib/dpkg/lock-open(13:权限被拒绝) E:无法锁定管理目录(/var/lib/dpkg/),您是root用户吗

  • sudo apt get安装libmagickwand dev

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libmagickwand-dev is already the newest version.
    The following packages were automatically installed and are no longer required:
      libgraphicsmagick3 libmagick++4 libgraphicsmagick++3 libgraphicsmagick1-dev
      libgraphics-magick-perl libperl5.14 libgraphicsmagick++1-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
    
    正在阅读软件包列表。。。多恩 构建依赖树 正在读取状态信息。。。多恩 libmagickwand dev已经是最新版本了。 以下软件包已自动安装,不再需要: libgraphicsmagick3 libmagick++4 libgraphicsmagick++3 libgraphicsmagick1开发 libgraphics magick perl libperl5.14 libgraphics magick++1-dev 使用“apt get autoremove”删除它们。 已升级0,新安装0,要删除0,未升级40


  • 但是上面仍然有相同的错误消息。

    查看错误输出,您缺少了rmagick的一个依赖项。试一试

    sudo apt-get install libmagickwand-dev sudo apt get安装libmagickwand dev 然后试试看

    gem install rmagick gem安装rmagick
    第二个问题可能是由于权限问题。更多关于您所采取的步骤的信息将有助于我们为您提供更好的答案。

    您应该发布您尝试过但不起作用的内容,否则人们会再次给您所有相同的答案。关于这一点,superuser已经有一个Q/a,请参阅更新操作。几天前我使用了bitnami实例,我没有安装rmagick,你需要更新版本吗?您可以尝试将Gemfile中的版本设置为与instance
    gem'rmagick'、\u instance'
    中的\u version\u相同。我想您可以使用
    rmagick-v
    @juanpstatas在实例中获得版本。好吧,如果我在控制台
    rmagick-v
    中运行,我得到
    对不起,找不到的命令已崩溃!请在以下地址提交错误报告:https://bugs.launchpad.net/command-not-found/+filebug请在报告中包含以下信息:未找到命令版本:0.2.44。我不确定权限,是否有类似权限重置的内容?或者只是在它前面添加
    sudo
    :)你就是那个人!