我试图安装一个连接器Rally,并bugzilla在我的MAC OSX.在运行安装脚本时,它会尝试安装gem并查找libxml2我的计算机上已存在的gems .
当它试图安装nokogiri时会发生这种情况.
这是成绩单:
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150121-48754-wgouyu.rb extconf.rb --use-system-libraries
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.4.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... OK
Running 'install' for libxml2 2.8.0... OK
Activating libxml2 2.8.0 (from /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin13.4.0/ports/libxslt/1.1.26... OK
Running 'configure' for libxslt 1.1.26... OK
Running 'compile' for libxslt …Run Code Online (Sandbox Code Playgroud) 我相信我误解了捆绑器的工作方式,但从bundle install 文档中可以看出捆绑器将使用本地安装的系统宝石.
...
--system:安装到系统位置($ BUNDLE_PATH或$ GEM_HOME),即使该软件包以前安装在此应用程序的其他位置
...
--system选项是默认选项.使用--path选项后,将其传递回切换,如下所述.
我没有使用rbenv/rvm或任何其他Ruby版本管理器.我使用ChefDK作为我的主要开发环境,它带有Ruby和一堆预装的宝石.
Gemfile的全部内容,还没有Gemfile.lock.
source 'https://rubygems.org'
gem 'nokogiri', '1.6.3.1'
Run Code Online (Sandbox Code Playgroud)
当地的nokogiri安装
$ gem list --local | grep nokogiri
nokogiri (1.6.6.2, 1.6.3.1, 1.5.5)
Run Code Online (Sandbox Code Playgroud)
System Gem位置安装了nokogiri 1.6.3.1
$ echo $GEM_HOME
/Users/arthur/.chefdk/gem/ruby/2.1.0
$ find /Users/arthur/.chefdk/gem/ruby/2.1.0 | grep nokogiri | grep 1.6.3.1
/Users/arthur/.chefdk/gem/ruby/2.1.0/cache/nokogiri-1.6.3.1.gem
/Users/arthur/.chefdk/gem/ruby/2.1.0/extensions/x86_64-darwin-12/2.1.0/nokogiri-1.6.3.1
/Users/arthur/.chefdk/gem/ruby/2.1.0/extensions/x86_64-darwin-12/2.1.0/nokogiri-1.6.3.1/mkmf.log
/Users/arthur/.chefdk/gem/ruby/2.1.0/gems/nokogiri-1.6.3.1
/Users/arthur/.chefdk/gem/ruby/2.1.0/gems/nokogiri-1.6.3.1/.autotest
/Users/arthur/.chefdk/gem/ruby/2.1.0/gems/nokogiri-1.6.3.1/.editorconfig
...
Run Code Online (Sandbox Code Playgroud)
但是,当我运行bundle install时,它会尝试为nokogiri安装和编译libxml2.
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using mini_portile 0.6.0
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following …Run Code Online (Sandbox Code Playgroud) 我是铁杆的新手,并尝试用宝石等来玩.
我的情况是我在我的网站上有这个导航菜单,我需要选择current_page链接..而不是建立一个帮助我想安装一个宝石所以我去找了一个找到了这个.
然后我按照文档说的那样说:
在我的gemfile中,我添加了
gem 'rack_current_page'
然后在项目根目录中 config.ru
require ::File.expand_path('../config/environment', __FILE__)
use Rack::CurrentPage
run Rails.application
Run Code Online (Sandbox Code Playgroud)
最后我跑了:
bundle并且rails s只是发现我有这个错误:
uninitialized constant Sprockets::SassCacheStore
在布局文件中包含应用程序样式表时发生错误.
我正在使用以下软件包/版本(仅列出可能产生影响的内容 - 如果我遗漏了某些东西,请告诉我)
(<gem> -v)
在进行卸载时,我删除了我添加的每一行 - 哎呀我还重置了我的项目文件,因为我刚刚开始处理它,运行一个新的捆绑包,重新启动服务器,检查网站但我得到的只是错误以上..
我用谷歌搜索并尝试在SO上寻找类似的问题,但找不到任何所以我唯一可以尝试的是卸载并重置我的git.
我肯定在寻找一些非常愚蠢但却无法找到答案所以我在这里;)
如果我错过了你们需要的信息,请提前感谢任何帮助.
写作的时间
我实际上做得很快gem pristine --all,也没有结果.
编辑1
好吧,因为随着猜测工作和相同的情况发生之前导致在(短)过去重新创建一个新的应用程序我卸载了compass-rails宝石并运行bundle后rails s测试事情是否开始工作.
它做了.然后我继续重新安装 compass-rails并继续工作......现在变得很困惑:S
嗨,我正在运行Ubuntu 15.04,我正在尝试安装Compass gem.我做了一个像Compass网站告诉我要做的宝石更新.然后我尝试安装Compass并得到以下错误.
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 -r ./siteconf20150609-16406-5iavn8.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.8 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/ffi-1.9.8/gem_make.out
Run Code Online (Sandbox Code Playgroud)
这是gem_make.out文件的输出
/usr/bin/ruby2.1 -r ./siteconf20150609-16446-49gin0.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Run Code Online (Sandbox Code Playgroud)
不知道此时该怎么做.谢谢!
我正在尝试使用以下命令安装Cocoapods版本0.35.0:
sudo gem install cocoapods --version 0.35.0
Run Code Online (Sandbox Code Playgroud)
当我尝试验证版本时
pod --version
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
---------------------------------------------
Error loading the plugin with path `/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/cocoapods_plugin.rb`.
NoMethodError - undefined method `tmpdir' for Dir:Class
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:66:in `<class:Try>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:8:in `<class:Command>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:5:in `<module:Pod>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:4:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/cocoapods_plugin.rb:1:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:104:in `safe_require'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:32:in `block in load_plugins'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:31:in `each'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:31:in `load_plugins'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:265:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
---------------------------------------------
0.35.0
Run Code Online (Sandbox Code Playgroud)
我试图卸载cocoapods和xcodeproj并重新安装它,但它不起作用.之前我还有其他三个类似的错误,但我已经摆脱了它们
sudo gem update --system
Run Code Online (Sandbox Code Playgroud)
不过,我无法修复最后一个错误.
我正在使用Axlsx gem和rails来创建Excel工作表.我需要修复和冻结标题.即使我们向下滚动,标题也应始终可见.rails版本3.2.1 gem'axlsx'
任何帮助表示赞赏?
我正在Arch Linux上安装nokogiri 1.6.6.2,因为如果没有它,metasploit安装就无法继续.我得到以下输出:
[ blackarch Downloads ]# gem install ./nokogiri-1.6.6.2.gem
Building native extensions. This could take a while...
ERROR: Error installing ./nokogiri-1.6.6.2.gem:
ERROR: Failed to build gem native extension.
/usr/bin/ruby -r ./siteconf20151103-1360-1u3d2zo.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
- 0001-Revert-Missing-initialization-for-the-catalog-module.patch
- 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
Team Nokogiri will keep …Run Code Online (Sandbox Code Playgroud) 我正在使用docker和rails.
我创建了一个本地gem并将其放入vendor/gems文件夹中.
我将它添加到我的Gemfile中:
gem 'my_gem', path: './vendor/gems/my_gem'
Run Code Online (Sandbox Code Playgroud)
在我的Dockerfile中
RUN mkdir /testapp
WORKDIR /testapp
ADD Gemfile /testapp/Gemfile
ADD Gemfile.lock /testapp/Gemfile.lock
RUN bundle install
ADD . /testapp
Run Code Online (Sandbox Code Playgroud)
运行后docker-compose build,它显示:
The path `/testapp/vendor/gems/my_gem` does not exist.
ERROR: Service 'web' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 13
Run Code Online (Sandbox Code Playgroud) 我正在尝试在Rails中使用英语gem,因此我可以访问$LAST_MATCH_INFO的隐秘版本$~。但是,尽管需要英语,但$LAST_MATCH_INFO始终是nil,尽管$~仍然有效。
这是我的预期行为irb:
'foo' =~ /o/ # => 1
$~ # => #<MatchData "o">
$LAST_MATCH_INFO # => nil
require 'english' # => true
$LAST_MATCH_INFO # => #<MatchData "o">
$LAST_MATCH_INFO == $~ # => true
Run Code Online (Sandbox Code Playgroud)
这是来自的损坏行为rails console:
'foo' =~ /o/ # => 1
$~ # => #<MatchData "o">
$LAST_MATCH_INFO # => nil
require 'english' # => false
# (Means it's already been required)
$LAST_MATCH_INFO # => nil
$LAST_MATCH_INFO …Run Code Online (Sandbox Code Playgroud) 当我安装gem时,<insert gem name>它会失败并显示错误ERROR: Failed to build gem native extension.
例如,当我尝试在新服务器上安装gems json,eventmachine,mysql2时,它几乎总是失败。
注意:这是一个质量检查类型的问题,即请参阅以下我提出的解决方案或加入讨论。