在Rails应用程序中使用rmagick时出错
试图运行rails应用程序时出现以下错误: -
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so:libMagickCore.so.4:无法打开共享对象文件:没有这样的文件或目录 - /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so(LoadError)from /opt/ruby-enterprise-1.8。 7-2010.02 / lib / ruby / site_ruby / 1.8 / rubygems / custom_require.rb:36:在require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
in'from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:354:in new_constants_in' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
需要'from /opt/ruby-enterprise-1.8.7 /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick.rb:11 -2010.02 / lib / ruby / site_ruby / 1.8 / rubygems / custom_require.rb:36:in gem_original_require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
gem_original_require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
require'from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby /gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
new_constants_in” /active_support/dependencies.rb:509:in require' from /home/amol/Amol_Backup/AMOL_BACKUP_20091021/PROJECTS/Fitsmi/life180/config/environment.rb:12 from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require”从/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
/ opt / ruby-企业1。 /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby中的8.7-2010.02 / lib / ruby / gems / 1.8 / gems / activesupport-2.1.0 / lib / active_support / dependencies.rb:354:in new_constants_in' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
require from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/ rails-2.1.0 / lib / commands / servers / webrick.rb:59 from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby /gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
new_constants_in” /active_support/dependencies.rb:509:in require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require'from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:在脚本/服务器的'require'中:3
文件RMagick2.so存在于给定路径/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib中。
以下是我的应用程序正在使用的版本: -
导轨2.3.5
红宝石1.8.7(2009-12-24 patchlevel 248)[x86_64-linux],MBARI 0x6770,Ruby Enterprise Edition 2010.02
rmagick(2.12.2)
imagemagick 6.2.8.0-4.el5-5.3
操作系统: - Centos 5
提前致谢....
我在RHEL5上解决了这个问题,并进行了以下更改:
添加以下几行:
/ usr / lib目录
在/ usr / local / lib目录
运行ldconfig
这解决了我的问题。 (关于下一个依赖关系..)
什么是Linux系统? 它似乎缺少libMagickCore.so.4
。 如果我看看我的Ubuntu,我发现它属于libmagickcoreX", where the
软件包libmagickcoreX", where the
X代表版本。我见过的最多的Ubuntu是3版本,但是我已经看到了版本4的RPM,所以在你的系统中你可以安装这个软件包版本。