简体   繁体   中英

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. 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 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 . 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.

My ruby version is 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. 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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