Ruby on rails 安装RVM,Ruby on Mac OS X Sierra:无法要求openssl
我遇到了在新Mac笔记本电脑上安装RVM+Rubies的问题,在安装RVM和自制软件后,Rails的安装遇到了错误:Ruby on rails 安装RVM,Ruby on Mac OS X Sierra:无法要求openssl,ruby-on-rails,macos,openssl,rvm,homebrew,Ruby On Rails,Macos,Openssl,Rvm,Homebrew,我遇到了在新Mac笔记本电脑上安装RVM+Rubies的问题,在安装RVM和自制软件后,Rails的安装遇到了错误: ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources ERROR: While executing gem ... (Gem::Except
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
背景和环境
- MacOSX10.12.3。(塞拉利昂)
- 自制1.1.8。安装了OpenSSL之后
- RVM 1.28.0
- Ruby 2.3.3 Rails(正在尝试安装最新版本)
- 环境变量(以下)在Shell环境中设置了以下变量
- LDFLAGS=-L/usr/local/opt/openssl@1.1/解放党
- CPPFLAGS=-I/usr/local/opt/openssl@1.1/包括
- PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
另一项需要注意的是,在安装RVM时,我确保RVM了解自制软件:
rvm autolibs enable
ram autolibs homebrew
ruby-2.3.3安装的输出如下:
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.12/x86_64/ruby-2.3.3.tar.bz2
Checking requirements for osx_brew.
Updating Homebrew...
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.3.3 - #configure
ruby-2.3.3 - #download
ruby-2.3.3 - #validate archive
ruby-2.3.3 - #extract
ruby-2.3.3 - #validate binary
Libraries missing for ruby-2.3.3: /Users/travis/.rvm/rubies/ruby-2.3.3/lib/libruby.2.3.0.dylib. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, trying to compile.
Checking requirements for osx_brew.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/grantsayer/.rvm/rubies/ruby-2.3.3, this may take a while depending on your cpu(s)...
ruby-2.3.3 - #downloading ruby-2.3.3, this may take a while depending on your connection...
ruby-2.3.3 - #extracting ruby-2.3.3 to /Users/grantsayer/.rvm/src/ruby-2.3.3
下一步
目前我陷入困境-无法通过此步骤或通过查看其他帖子来验证,以获得有效的解决方案。我找到了前面描述的问题的解决方案。以下步骤概述了如何解决此问题 清理
ruby-e“$(curl-fsSL)删除了自制软件的安装https://raw.githubusercontent.com/Homebrew/install/master/uninstall)“
RVM内爆
ruby-e“$(curl-fsSL)安装自制软件
https://raw.githubusercontent.com/Homebrew/install/master/install)“
Brew升级
和Brew医生
\curl-sSL安装RVM(再次!)https://get.rvm.io |bash-s稳定
RVM autolibs homebrew
rvm osx ssl certs status all
检查rvm空间是否知道OpenSSL证书。运行此命令会产生以下输出:Certificates for/usr/local/etc/openssl/cert.pem:update.
gem安装rails安装rails
在最后一步中,安装成功,Rails正在工作(最后!)如果其他阅读器不工作的话- 试试这个:
rvm get branch /bugfix/3923_set_osx_brew_openssl_compiler_config
rvm install 2.4.0
如果这对您有效,并告诉开发人员您非常感谢他的努力:)您能展示一下安装ruby-2.3.3和rails所使用的命令吗?只是一种预感,但我不建议通过rvm安装rails。更可靠的方法是通过rvm安装ruby,然后通过
gem安装rails--no ri--no rdoc安装rails
尝试检查rvm正在使用的证书的状态:rvm osx ssl certs status all
。这将输出每个证书的状态。如果它不是最新的,您可以使用rvm osx ssl certs update all
更新它们。同意使用gem安装rails-这是我通常做的-在描述中可能不清楚。检查证书rvm正在使用并且运行该命令没有输出。非常感谢,这实际上是唯一对我有效的解决方案,…并尝试了来自各地的一些。很高兴这有帮助。还有一项——我发现我不需要导出环境变量。我想,重置所有内容并重新安装后,所有内容都得到了整理。是的,也不必导出env vars。我在自行编译的Ruby安装中遇到了类似的问题。在用自制软件安装OpenSSL之后,重新编译Ruby对我来说是可行的。谢谢我遇到了另一个问题:rvm
版本是最新的稳定版本(v1.29.3),而这个版本的rvm是强制的openssl@1.1由自制安装,由于。这个问题自2017年9月起就出现了,但还没有新的稳定版本。另外,我在这个答案的export
s中添加的另一个步骤是export RUBY\u CONFIGURE\u OPTS=--with openssl dir=“$(brew--prefix openssl)”
,但我不知道是否需要这样做。