Pee*_*151 2 ruby ruby-on-rails paperclip
这真让我抓狂...
我在这里看到了几个问题与nokogiri(一个在这里),但它们与脚本有关.我有一个完整的rails应用程序,我刚刚安装了paperclip和amazon-aws,当我进行捆绑安装时也下载了nokogiri ..
gem dependency paperclip
...
nokogiri (>= 0, development)
...
这就是这个宝石被引入的地方..
我读到Nokogiri应该在我的gemfile中,所以我做了一个
gemfile.rb =>
gem 'nokogiri'
gem 'aws-sdk'
gem 'paperclip'
现在我的本地服务器无法启动...
nokogiri-1.6.2.1/lib/nokogiri.rb:29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
我也尝试过nokogiri 1.4.4 ......
以前(在我的gemfile中没有nokogiri)服务器会加载,但是当我尝试上传图像时会出现加载错误...同上面的错误
cannot load such file -- nokogiri/nokogiri
关于nokogiri的thotbot/paperclip文档中没有任何内容.我试过了
gem install nokogiri
和
gem pristine nokogiri
没有骰子..
我在捆绑上注意到这条消息:
        IMPORTANT!  Nokogiri builds and uses a packaged version of libxml2.
        If this is a concern for you and you want to use the system library
        instead, abort this installation process and reinstall nokogiri as
        follows:
            gem install nokogiri -- --use-system-libraries
        If you are using Bundler, tell it to use the option:
            bundle config build.nokogiri --use-system-libraries
            bundle install
        However, note that nokogiri does not necessarily support all versions
        of libxml2.
        For example, libxml2-2.9.0 and higher are currently known to be broken
        and thus unsupported by nokogiri, due to compatibility problems and
        XPath optimization bugs.
所以我做到了
bundle config build.nokogiri --use-system-libraries
bundle install
我得到了同样的错误.所以我的智慧结束了.有什么建议?
****编辑:****
我认为这是与AWS-SDK gem的交互,不确定.他们在13年11月放弃了对旧版本的支持,但我正在使用它
gem 'aws-sdk', '~> 1.0'
gem 'nokogiri', '~> 1.5.0'
感叹我也试过Nokogiri.org的安装方法......
brew install libxml2 libxslt
brew link libxml2 libxslt
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 
仍有问题.Nokogiri Nokogiri !!!
我遇到了同样的问题.
我不得不安装
gem pristine nokogiri
然后我跑了
bundle config build.nokogiri --use-system-libraries
bundle install
然后得到了
Restored nokogiri-1.6.2.1
Building native extensions with: '--use-system-libraries'
This could take a while...
Building nokogiri using system libraries.
Restored nokogiri-1.6.3.1
这似乎解决了我的问题,希望这有帮助!
| 归档时间: | 
 | 
| 查看次数: | 2374 次 | 
| 最近记录: |