当我启动rails服务器时ImageMagick的警告

时间:2014-05-01 17:51:04

标签: ruby-on-rails ruby rmagick

最近,当我启动rails服务器时,我有一长串警告。虽然它不会影响我的应用程序,但我想知道如何解决警告。我的估计是imagemagick以某种方式被称为两次?

当我在警告之前和之后检查我的git日志时。我想知道如何解决这个问题。

-     bcrypt-ruby (3.1.2)
-     better_errors (1.0.1)
+     bcrypt (3.1.7)
+     bcrypt-ruby (3.1.5)
 -      bcrypt (>= 3.1.3)
+     better_errors (1.1.0)

bcrypt是否与imagemagick有关?

/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/http/mime_type.rb:166: warning: already initialized constant Mime::PDF
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/http/mime_type.rb:166: warning: previous definition of PDF was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:44: warning: already initialized constant Magick::PercentGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:44: warning: previous definition of PercentGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:45: warning: already initialized constant Magick::AspectGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:45: warning: previous definition of AspectGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:46: warning: already initialized constant Magick::LessGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:46: warning: previous definition of LessGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:47: warning: already initialized constant Magick::GreaterGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:47: warning: previous definition of GreaterGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:48: warning: already initialized constant Magick::AreaGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:48: warning: previous definition of AreaGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:49: warning: already initialized constant Magick::MinimumGeometry
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:49: warning: previous definition of MinimumGeometry was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:52: warning: already initialized constant Magick::Geometry::FLAGS
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:52: warning: previous definition of FLAGS was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:53: warning: already initialized constant Magick::Geometry::RFLAGS
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:53: warning: previous definition of RFLAGS was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:92: warning: already initialized constant Magick::Geometry::W
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:92: warning: previous definition of W was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:93: warning: already initialized constant Magick::Geometry::H
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:93: warning: previous definition of H was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:94: warning: already initialized constant Magick::Geometry::X
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:94: warning: previous definition of X was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:95: warning: already initialized constant Magick::Geometry::Y
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:95: warning: previous definition of Y was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:96: warning: already initialized constant Magick::Geometry::RE
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:96: warning: previous definition of RE was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:147: warning: already initialized constant Magick::Draw::ALIGN_TYPE_NAMES
...
...
...
...
2.13.2/lib/RMagick.rb:750: warning: already initialized constant Magick::IPTC::Application::ObjectData_Preview_File_Format
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:750: warning: previous definition of ObjectData_Preview_File_Format was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:751: warning: already initialized constant Magick::IPTC::Application::ObjectData_Preview_File_Format_Version
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:751: warning: previous definition of ObjectData_Preview_File_Format_Version was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:752: warning: already initialized constant Magick::IPTC::Application::ObjectData_Preview_Data
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:752: warning: previous definition of ObjectData_Preview_Data was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:756: warning: already initialized constant Magick::IPTC::Pre_ObjectData_Descriptor::Size_Mode
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:756: warning: previous definition of Size_Mode was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:757: warning: already initialized constant Magick::IPTC::Pre_ObjectData_Descriptor::Max_Subfile_Size
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:757: warning: previous definition of Max_Subfile_Size was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:758: warning: already initialized constant Magick::IPTC::Pre_ObjectData_Descriptor::ObjectData_Size_Announced
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:758: warning: previous definition of ObjectData_Size_Announced was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:759: warning: already initialized constant Magick::IPTC::Pre_ObjectData_Descriptor::Maximum_ObjectData_Size
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:759: warning: previous definition of Maximum_ObjectData_Size was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:763: warning: already initialized constant Magick::IPTC::ObjectData::Subfile
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:763: warning: previous definition of Subfile was here
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick.rb:767: warning: already initialized constant Magick::IPTC::Post_ObjectData_Descriptor::Confirmed_ObjectData_Size
/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/rmagick.rb:767: warning: previous definition of Confirmed_ObjectData_Size was here

1 个答案:

答案 0 :(得分:8)

在我的情况下,在我的gemfile中停止需要它:

gem 'rmagick', require: false