无法安装 gems,因为“未定义方法 `invoke_with_build_args' for nil:NilClass" [英] Can't install gems because "undefined method `invoke_with_build_args' for nil:NilClass"

查看:13
本文介绍了无法安装 gems,因为“未定义方法 `invoke_with_build_args' for nil:NilClass"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ruby 轨道上,我正在安装 Ruby on Rails.

I'm on the Ruby track and I'm in the installation process of Ruby on Rails.

我正在尝试安装 gems,但它没有发生,我不确定为什么以及如何修复它.

I'm trying to install gems but it's not happening and i'm not sure why and how to fix it.

$gem install bundler

ERROR:  Loading command: install (LoadError)
dlopen(/Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-    darwin13.0/openssl.bundle, 9): Library not loaded:     /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-    darwin13.0/openssl.bundle
  Reason: image not found -     /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

这是我尝试过的解决方案之一:

Here is one of the solutions that i've tried:

$CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1

rbenv: /Users/nthulanemakgato/.rbenv/versions/2.1.1 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...

BUILD FAILED

Inspect or clean up the working tree at     /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-    build.20140429120202.53716.log

Last 10 log lines:
x yaml-0.1.6/win32/vc6/test_reader.dsp
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml-  0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl

BUILD FAILED

Inspect or clean up the working tree at     /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-  build.20140429120202.53716.log

Last 10 log lines:
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml-        0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl
make: *** No targets specified and no makefile found.  Stop.

我已经安装了 openssl-1.0.1g

I have openssl-1.0.1g installed

我使用的是 Mac 10.9.2
ruby 2.1.1p76 (2014-02-24 修订版 45161) [x86_64-darwin13.0]
rbenv 0.4.0-97-gfe0b243

I'm using Mac 10.9.2
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
rbenv 0.4.0-97-gfe0b243

这与其他问题不同,因为我使用的是 rbenv,而其他人则问我无法使用的 rvm 相关问题.

This is not like other questions in that i'm using rbenv whereas others ask rvm related questions which I can't use.

提前致谢.

推荐答案

我发现虽然我已经安装了 openSSL,但我需要在它被识别之前brew upgrade ruby​​.另一个迷宫般的曲折小段落,都一样.

I found that although I already had openSSL installed I needed to brew upgrade ruby before it was recognized. Another maze of twisty little passages, all alike.

这篇关于无法安装 gems,因为“未定义方法 `invoke_with_build_args' for nil:NilClass"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆