简体   繁体   English

我无法在OSX 10.7.5上安装rails

[英]I can't install rails on OSX 10.7.5

Whenever I run 每当我跑步

    sudo gem install rails

I get the following output: 我得到以下输出:

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

RVM version: rvm 1.18.14 and Ruby is 2.0.0p0 RVM版本:rvm 1.18.14,Ruby是2.0.0p0

you need to reinstall your rubies: 你需要重新安装你的红宝石:

rvm get head --autolibs=3
rvm pkg remove
rvm reinstall all --force

the new autolibs supporrt will take care of updating dependencies and including them in ruby 新的autolibs supporrt将负责更新依赖项并将它们包含在ruby中

Do you have Homebrew installed on your system? 你的系统上安装了Homebrew吗? If so, try 如果是这样,试试吧

brew install openssl

in the command line. 在命令行中。

hmm, you have rvm but why you need sudo?I thought rvm is in sandbox mode . 嗯,你有rvm,但为什么你需要sudo?我认为rvm处于沙盒模式。 Anyway, the error just means it can't find ssl path. 无论如何,错误只是意味着它无法找到ssl路径。 First, make sure you have openssl installed. 首先,确保已安装openssl。 If not then you need to install it(brew, macport etc) or rvm pkg install openssl and let rvm manage its path(you have rvm already). 如果没有那么你需要安装它(brew,macport等)或rvm pkg install openssl并让rvm管理它的路径(你已经有rvm)。 After that, you will need to reinstall ruby. 之后,您将需要重新安装ruby。 RVM guide is here RVM指南就在这里

You don't use sudo. 你不使用sudo。 sudo is ONLY used for doing a multi-user install, and only then during the initial installation, and adding your user to the rvm group (if the installer did not do it for you which usually indicates you did the install wrong in the first place) sudo仅用于进行多用户安装,并且仅在初始安装期间,并将您的用户添加到rvm组(如果安装程序没有为您执行此操作,通常表明您首先安装错误)

I figured it out! 我想到了!

So First I removed everything to do with RVM as suggested in some of the answers. 所以首先我按照一些答案中的建议删除了与RVM有关的所有内容。 Rebooted. 重新启动。 Installed the latest Version of Xcode and the command line tools from Xcode (Xcode-prefereces-downloads). 安装了最新版本的Xcode和Xcode的命令行工具(Xcode-prefereces-downloads)。 Then rebooted again, and finally used RailsInstaller. 然后重新启动,最后使用RailsInstaller。 Once I used that rails was back on and all is good in the world. 一旦我使用了轨道重新开启,世界上的一切都很好。 Thanks for the help everyone. 感谢大家的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM