簡體   English   中英

rmagick阻止rails服務器工作

[英]rmagick preventing rails server from working

我必須使用rmagick,它不允許我啟動rails服務器。 我已經在這里閱讀了谷歌,到目前為止,這些解決方案都沒有提供幫助。 圖書館出了問題,我不知道如何修復它。

如果有人有修復這個確切問題的建議,將非常感激。

/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `require': dlopen(/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libltdl.7.dylib (LoadError)
  Referenced from: /usr/local/lib/libMagickCore-Q16.7.dylib
  Reason: image not found - /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler.rb:132:in `require'
    from /Users/lexi87/dating/config/application.rb:7:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我能夠修復此錯誤,因此如果他們遇到同樣的問題,這應該適用於其他任何人。

以下是修復的步驟:

brew uninstall imagemagick
gem uninstall rmagick
sudo gem install json # (not sure this step is needed)
sudo apt-get install libmagick9-dev
bundle install

然后它完美無缺。 現在我可以啟動rails服務器,我不會收到任何錯誤。 希望這有助於某人!

您只需要使用當前的imagemagick重新安裝rmagick

gem install rmagick

在其他一些問題中,我發現以下問題通過使用來解決問題,

gem pristine rmagick

我的安裝有幾個問題,對我有用的是

brew uninstall imagemagick
gem uninstall rmagick
brew install imagemagick
bundle install
brew unlink libtool 
brew link libtool

沒有第一個我在嘗試安裝rmagick時遇到錯誤,沒有最后兩個啟動rails服務器時出錯

我也有這個問題。 我嘗試了很多不同的技巧,奇怪的是,這種奇怪的做法是有效的。 前兩個命令似乎沒用,但考慮到我不知道這是如何工作的,我也將它們留在了。

不要問問題,只需運行它們並擁抱rmagick

brew install libtool --universal
brew link libtool
brew unlink libtool && brew link libtool
gem uninstall rmagick
gem install rmagick

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM