简体   繁体   English

尝试安装导轨。 错误1。 没有这样的文件要加载——openssl 错误 2. 未定义的方法 `invoke_with_build_args' for nil:NilClass

[英]Trying to install rails. Error1. no such file to load -- openssl Error 2. undefined method `invoke_with_build_args' for nil:NilClass

I'm trying to get rails downloaded to my machine.我正在尝试将 Rails 下载到我的机器上。 I am pretty sure this is an older setup and am not sure what is wrong.我很确定这是一个较旧的设置,我不确定有什么问题。 I've been at this for hours.我一直在这几个小时。 Whenever I type rails c I get...每当我输入rails c我得到...

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

Then I type what it says to type and get:然后我输入它所说的输入并得到:

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

I explored this for a while and thought I didn't have openssl installed so I downloaded it and now when i type openssl i get a prompt that looks like "OpenSSL>" and when I type whereis openssl , I get usr/bin/openssl .我探索了一段时间,认为我没有安装 openssl 所以我下载了它,现在当我输入openssl我得到一个看起来像“OpenSSL>”的提示,当我输入whereis openssl ,我得到usr/bin/openssl . Those two things lead me to believe that openssl is installed on my laptop but for some reason when I go to gem install rails I still get an error.这两件事让我相信我的笔记本电脑上安装了 openssl,但由于某种原因,当我去gem install rails我仍然遇到错误。

My ruby version is 1.8.7.我的红宝石版本是 1.8.7。 This is the version the application I'm trying to gain access to was built in. I'm on a MacOS Mojave 10.14.16.这是我尝试访问的应用程序的内置版本。我使用的是 MacOS Mojave 10.14.16。 If anyone has any tips or could point me in the right direction I'd very much appreciate it.如果有人有任何提示或可以指出我正确的方向,我将非常感激。

Thanks谢谢

You have to install OpenSSL first and recompile ruby again:您必须先安装 OpenSSL 并再次重新编译 ruby​​:

RVM: RVM:

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

please write complete name version of ruby-1.8.7请写出ruby-1.8.7的全名版本

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

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