ruby 2.0 rails gem 安装错误“无法加载此类文件--openssl" [英] ruby 2.0 rails gem install error "cannot load such file -- openssl"

查看:25
本文介绍了ruby 2.0 rails gem 安装错误“无法加载此类文件--openssl"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 osx 10.8.2 安装 ruby 2.0 和....尝试运行 "sudo gem install rails"

I am using osx 10.8.2 installed ruby 2.0 and.... got this when trying to run "sudo gem install rails"

$ sudo gem install rails
ERROR:  Loading command: install (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

我之前的 ruby​​ 1.9.x 和 rails 3.2.x 工作正常

I had ruby 1.9.x and rails 3.2.x working alright before

推荐答案

你必须先安装 OpenSSL 并重新编译 ruby​​:

You have to install OpenSSL first and recompile ruby again:

RVM:

rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr

这篇关于ruby 2.0 rails gem 安装错误“无法加载此类文件--openssl"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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