Ruby on rails 在MacOS Sierra上安装Rmagick和Imagemagick时出错

Ruby on rails 在MacOS Sierra上安装Rmagick和Imagemagick时出错,ruby-on-rails,bash,rubygems,imagemagick,rmagick,Ruby On Rails,Bash,Rubygems,Imagemagick,Rmagick,我在安装时遇到此错误Imagemagick@6在我的mac电脑上。这将阻止我在本地计算机上运行rails应用程序。我尝试了很多选择,比如更改bash配置文件、向config添加内容等。我尝试删除gem和rmv文件,然后重新安装 这是我每次都能得到的 Building native extensions with: '--with-opt-lib /usr/local/opt/imagemagick@6/lib --with-opt-include /usr/local/opt/imagemagi

我在安装时遇到此错误Imagemagick@6在我的mac电脑上。这将阻止我在本地计算机上运行rails应用程序。我尝试了很多选择,比如更改bash配置文件、向config添加内容等。我尝试删除gem和rmv文件,然后重新安装

这是我每次都能得到的

Building native extensions with: '--with-opt-lib /usr/local/opt/imagemagick@6/lib --with-opt-include /usr/local/opt/imagemagick@6/include'
    This could take a while...
    ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-opt-lib /usr/local/opt/imagemagick@6/lib --with-opt-include /usr/local/opt/imagemagick@6/include
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1674:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:2378:in `init_mkmf'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:2415:in `<module:MakeMakefile>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:47:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from extconf.rb:4:in `<main>'


    Gem files will remain installed in /Users/neves/.rvm/gems/ruby-2.3.1@aut-rails4/gems/rmagick-2.16.0 for inspection.
    Results logged to /Users/neves/.rvm/gems/ruby-2.3.1@authorea-rails4/gems/rmagick-2.16.0/ext/RMagick/gem_make.out
使用:'--使用opt lib/usr/local/opt构建本机扩展/imagemagick@6/lib——带有opt include/usr/local/opt/imagemagick@6/包括
这可能需要一段时间。。。
错误:安装rmagick时出错:
错误:无法生成gem本机扩展。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/Ruby extconf.rb——带有opt lib/usr/local/opt/imagemagick@6/lib——带有opt include/usr/local/opt/imagemagick@6/包括
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/mkmf.rb:1674:在'dir_config'中:未定义true的方法'split':TrueClass(NoMethodError)
from/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/mkmf.rb:2378:in'init_mkmf'
from/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/mkmf.rb:2415:in`'
from/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/mkmf.rb:47:in`'
from/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
from/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/Ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
来自extconf.rb:4:in`'
Gem文件仍将安装在/Users/neves/.rvm/gems/ruby-2.3中。1@aut-轨道4/gems/rmagick-2.16.0进行检查。
结果记录到/Users/neves/.rvm/gems/ruby-2.3。1@authorea-rails4/gems/rmagick-2.16.0/ext/rmagick/gem_make.out
首先更新brew
brew更新

然后安装imagemagic
brew安装imagemagick@6
然后配置路径并安装rmagic gem

PKG\u CONFIG\u PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem安装rmagick

首先更新brew
brew更新

然后安装imagemagic
brew安装imagemagick@6
然后配置路径并安装rmagic gem

PKG\u CONFIG\u PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem安装rmagick