最近我有一長串警告,當我啓動我的導軌服務器。雖然它不影響我的應用程序,但我想知道如何解決警告。我的估計是imagemagick不知何故被稱爲兩次?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
在短暫的一瞥,它看起來真的像你加載ImageMagick的兩倍。它是否包含在寶石中,然後又在其他地方使用? –
它看起來像你第一次做'需要'rmagick'',然後'需要'RMagick''。 Ruby會將它們視爲不同的文件,但在Mac上,文件系統不區分大小寫,因此它們是相同的文件。它應該是'RMagick' - 你可能需要在''Gemfile''中加入::require =>'RMagick'。我不知道使用'action_dispatch'的前兩行發生了什麼,所以也許它是別的。 – matt
你能弄清楚這一點嗎?獲取相同的錯誤 – kibaekr