【问题标题】:How to install Social Stream如何安装社交流
【发布时间】:2016-01-31 00:03:32
【问题描述】:

我正在尝试将 Social Stream gem 与我的 Rails 应用程序集成。但是,它会返回我已经拥有的依赖项列表并声明它们是必需的。运行 bundle update 时,如何在 gemfile 中识别 gem?

You need to install git to be able to use gems from git repositories. For help
installing git, please refer to GitHub's tutorial at
https://help.github.com/articles/set-up-git

我也在github上查了网页,不过只说明了如何设置git,我已经做过了。还有另外一条错误信息指出ruby文件夹或项目中没有安装git文件:

C:\Ruby22-x64>gem install social_stream-base
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing social_stream-base:
    ERROR: Failed to build gem native extension.

C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20160128-17192-1djdrcu.rb extconf.rb
The system cannot find the path specified.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit    http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You  may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=C:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/lib
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib
    --with-libxslt-config
    --without-libxslt-config
    --with-pkg-config
    --without-pkg-config
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-pkg-config
    --without-pkg-config
    --with-libiconv-config
    --without-libiconv-config
    --with-pkg-config
    --without-pkg-config

    extconf failed, exit code 1

    Gem files will remain installed in C:/Ruby22-   x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.5.11 for inspection.
    Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-  mingw32/2.2.0/nokogiri-1.5.11/gem_make.out

如何让 git 被看到?

【问题讨论】:

  • 你已经先运行 bundle install 了吧?
  • 是的,但它一直显示很长的错误消息。
  • 还说需要安装git,已经安装好了。
  • 好吧,请注意用长错误消息更新您的问题,如果您无法安装它,这有点相关..
  • 我已将错误消息上传到问题中。

标签: ruby-on-rails ruby social-stream


【解决方案1】:

好的,所以捆绑更新不会为您做任何事情,捆绑安装是您需要做的,但正如我们发现的那样,这是一个错误。更新只会在已安装的内容上运行。

我还注意到,在运行“gem install social_stream-base”时,使用 bundle 时正确的方法是将 gem 'social_stream-base' 添加到您的 gemfile 中,然后运行 ​​bundle install。我只是为了完整性而添加它。

根据您的错误消息,对 Nokogiri 存在依赖性。以下是如何在 Windows 上安装它的链接:http://www.nokogiri.org/tutorials/installing_nokogiri.html#windows

您需要安装 Nokogiri,并且可能会遇到许多其他问题,这是我尝试在 Windows 中运行这些东西时的常态。如果您尝试但无法解决问题,则返回 Stack O。

但我主要担心的是:

就你的 git 问题而言,这不会让你进步,但为了完整起见,我建议你参考 Can't run bundle update on Windows,它有各种不同的修复方式。

【讨论】:

    【解决方案2】:

    我决定为我正在构建的社交网络应用程序制作自己的宝石。由于尚未为 rails 4.x 构建社交流,我认为我不会使用它。谢谢。

    【讨论】:

      猜你喜欢
      • 2018-08-20
      • 2019-11-13
      • 2017-07-21
      • 2012-12-14
      • 2012-04-29
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 2014-10-12
      相关资源
      最近更新 更多