更新RMagick和Imagemagick是一个痛苦的期待.我用自制软件更新了Mac上的Imagemagick版本(MacOS El Capitan版本10.11.5),用于Ruby 2.3中的一个项目6.9.5-9
$ convert --version
Version: ImageMagick 6.9.5-9 Q16 x86_64 2016-09-09
Run Code Online (Sandbox Code Playgroud)
现在Ruby 1.8.7中的一个旧项目拒绝使用错误消息"这个RMagick的安装配置了ImageMagick 6.8.9但ImageMagick 6.9.5-9正在使用中".因此我卸载了"rmagick",但无法重新安装
$ gem install rmagick -v 2.16.0
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
checking for /usr/local/opt/gcc46/bin/gcc-4.6... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
checking for Ruby version …Run Code Online (Sandbox Code Playgroud) 我见过其他人在Mountain Lion上安装RMagick同样的问题但是没有一个建议的解决方案允许我成功安装rmagick.
这是我得到的错误消息:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
checking for Ruby version >= 1.8.5... yes
checking for /usr/local/bin/gcc-4.2... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the …Run Code Online (Sandbox Code Playgroud) 我使用脚本安装ImageMagick http://github.com/masterkain/ImageMagick-sl
过了一会儿,我安装了ImageMagick.
然后我跑了sudo gem install rmagick并得到了
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in...
Run Code Online (Sandbox Code Playgroud)
我正在使用Ruby 1.9.2和Rails 3在OSX Snow Leopard中工作.任何想法?
我想在我的本地机器上运行一个项目.我在Mac OS系统上安装了Ruby和Rails.它运作正常.我可以创建一个新项目,并且可以正常运行它而不会出现任何错误,但是当我尝试运行现有项目时,它说我们必须这样做bundle install.当我运行该命令时,我收到以下错误:
"An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling."
Run Code Online (Sandbox Code Playgroud)
当我运行gem install rmagick -v '2.13.2'它时给我以下错误:
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin
*** extconf.rb failed ***
Could not create Makefile due …Run Code Online (Sandbox Code Playgroud) 我在安装rmagick时遇到问题.我正在使用ruby on rails框架开发我的项目.我在我的gemfile中包含了rmagick gem.我收到以下错误消息:
checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.
Run Code Online (Sandbox Code Playgroud)
我使用brew安装了imagemagick:
imagemagick-6.8.9-8 already installed
Run Code Online (Sandbox Code Playgroud)
imagemagick文件夹位于/ usr/local/Cellar目录中
在我的终端:
Zoulfias-iMac:Myapp zoulfiahall $ rvm使用ruby-2.0.0-p481
Using /Users/zoulfiahall/.rvm/gems/ruby-2.0.0-p481
Zoulfias-iMac:Myapp zoulfiahall$ sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... yes
checking for Magick-config... yes
checking for ImageMagick …Run Code Online (Sandbox Code Playgroud) 我在很长一段时间运行后,Debian服务器和升级的所有软件包(apt-get update,apt-get upgrade,apt-get distro-upgrade).然后rmagick不再工作了因为imagemagick被更新了.
所以我跑了:
gem uninstall rmagick
bundle install
Run Code Online (Sandbox Code Playgroud)
然后我得到了这个:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
*** 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 …Run Code Online (Sandbox Code Playgroud) 在尝试安装fileutils gem时,我得到以下输出:
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 …Run Code Online (Sandbox Code Playgroud) 可能重复:
ImageMagick/RMagick - 无法安装RMagick 2.13.1.找不到Magick-config
当我尝试运行我的开发控制台(MAC OS X/Snow Leopard)时,我收到以下错误.有谁知道解决方案?
/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in .:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
*** 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.
Run Code Online (Sandbox Code Playgroud) 我正在使用载波,但我遇到了这个问题:假设项目交付后,您需要添加一个区域,其中需要以不同的大小显示系统中的图像。我不想为系统中已经存在的每个图像重新生成新的尺寸。我希望能够在需要视图时生成(并缓存它)。像这样:“ />。如果新的尺寸500x150已经存在,则返回缓存的URL,否则生成它并返回缓存的URL
我非常喜欢Carrierwave,但很遗憾,它没有开箱即用的即时调整大小功能。所有人都说添加此功能应该很简单,但是我什么也没发现。唯一接近的是此上传器https://gist.github.com/DAddYE/1541912 我必须对其进行修改才能使其正常工作,所以这里是我的版本
class ImageUploader < FileUploader
include CarrierWave::RMagick
#version :thumb do
# process :resize_to_fill => [100,100]
#end
#
#version :thumb_square do
# process :resize_to_fill => [100,100]
#end
#
#version :full do
# process :resize_to_fit => [550, 550]
#end
def re_size(string_size)
if self.file.nil?
return self
end
begun_at = Time.now
string_size.gsub!(/#/, '!')
uploader = Class.new(self.class)
uploader.versions.clear
uploader.version_names = [string_size]
img = uploader.new(model, mounted_as)
img.retrieve_from_store!(self.file.identifier)
cached = File.join(CarrierWave.root, img.url)
unless File.exist?(cached)
img.cache!(self)
img.send(:original_filename=, self.file.original_filename)
size = string_size.split(/x|!/).map(&:to_i)
resizer = case …Run Code Online (Sandbox Code Playgroud) ruby-on-rails on-the-fly ondemand image-resizing carrierwave
我通过提供MagickWand.h的路径尝试了一切,我已经安装了命令工具.谁能帮我吗 ?
$ gem install rmagick -v 2.13.1
Run Code Online (Sandbox Code Playgroud)
构建原生扩展.这可能需要一段时间...错误:安装rmagick时出错:错误:无法构建gem原生扩展.
/Users/ghazanfarali/.rvm/rubies/ruby-1.8.7-p357/bin/ruby extconf.rb检查Ruby版本> = 1.8.5 ...是检查/usr/bin/gcc-4.2 ...是检查Magick-config ...是检查ImageMagick版本> = 6.4.9 ...是检查HDRI禁用版本的ImageMagick ...是检查stdint.h ...没有检查sys/types.h ......没有检查魔杖/ MagickWand.h ......没有
无法安装RMagick 2.13.1.找不到MagickWand.h. *extconf.rb失败*由于某些原因无法创建Makefile,可能缺少必要的库和/或标头.检查mkmf.log文件以获取更多详细信息.您可能需要配置选项.
提供的配置选项: - 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 =/Users/ghazanfarali/.rvm/rubies/ruby-1.8.7-p357/bin/ruby
Gem文件将保留在/Users/ghazanfarali/.rvm/gems/ruby-1.8.7-p357/gems/rmagick-2.13.1中进行检查.结果登录到/Users/ghazanfarali/.rvm/gems/ruby-1.8.7-p357/gems/rmagick-2.13.1/ext/RMagick/gem_make.out"
像许多其他人一样,我在运行bundle install时在Ubuntu上安装rmagick时遇到了麻烦.
我在bundle install命令上遇到这个错误:
Installing rmagick (2.13.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.8.7-p371/bin:/usr/local/rvm/gems/ruby-1.8.7-p371@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p371/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
*** 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 …Run Code Online (Sandbox Code Playgroud) imagemagick ×8
rmagick ×7
ruby ×4
bundler ×1
carrierwave ×1
gem ×1
imagick ×1
macos ×1
macos-sierra ×1
on-the-fly ×1
ondemand ×1
rubygems ×1
rvm ×1
ubuntu ×1