RSpec throws segmentation fault

你。 提交于 2019-12-05 16:29:18
rorra

Are you developing on Mac? Nokogiri is the gem that causes those segmentation faults; it's a very common issue on Mac, especially if you have brew installed.

You can review the right way to install nokogiri at this url.

First, uninstall all nokogiri versions from your system:

gem uninstall nokogiri
(select all)

Next, if you have brew, try to run:

brew install libxml2 libxslt
brew link --force libxml2 libxslt

and finally install the versions of nokogiri that you need (based on your Gemfile, it's 1.6.0):

gem install nokogiri --version 1.6.0 -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2  \
                                     --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib  \
                                     --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 \
                                     --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include  \
                                     --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib

Finally, bundle again and you should be able to run the specs without problems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!