Error installing any ruby version with RVM on OSX

2019-03-08 04:49发布

问题:

Guys I'm about to kill myself with this one!

I had some problems with RVM installing multiple versions of Ruby, and following a thread on Stackoverflow I decided to remove it completely. After reinstalling RVM, I am unable to install any Ruby version at all.

  • Mac OS X
  • RVM 1.20.10 stable
  • Homebrew 0.9.4

Here are some logs:

rvm install 2.0.0-p0

or:

rvm install 2.0.0-p195 --autolibs=enabled

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Already up-to-date.
Installing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libxml2, libxslt, libksba, openssl…
Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config libyaml readline libxml2 libxslt libksba openssl',
please read /Users/admin/.rvm/log/ruby-2.0.0-p0/1368903329_package_install_autoconf_automake_libtool_pkg-config_libyaml_readline_libxml2_libxslt_libksba_openssl.log

Logfile reads:

[2013-05-18 22:55:29] requirements_osx_brew_libs_install
Error: No such keg: /usr/local/Cellar/autoconf
There were package installation errors, make sure to read the log.
Check Homebrew requirements github.com/mxcl/homebrew/wiki/Installation

brew doctor

Your system is ready to brew.

brew cleanup

Removing: /Library/Caches/Homebrew/automake-1.13.1.tar.gz…
Error: Permission denied — /Library/Caches/Homebrew/automake-1.13.1.tar.gz

brew reinstall autoconf

Error: No such keg: /usr/local/Cellar/autoconf

Help!

回答1:

I ran into the same issue, you need to manually install all the required packages using Brew. For me I had to run the following installs:

brew install autoconf
brew install automake
brew install libtool
brew install apple-gcc42
brew install libyaml
brew install libxslt
brew install libksba
brew install openssl

You just need to keep running "rvm requirements" and reading the log and installing the packages needed until there are no more errors.



回答2:

After installing RVM, You'll want to run

rvm requirements

to see if anything else is required to install ruby and rails first.

here is the similar question asked rvm install ruby



回答3:

This solved problem for me

sudo chown -R `whoami` /Library/Caches/Homebrew/


回答4:

I had the same problem

brew install pkg-config

worked for me



回答5:

I aswell ran into the permission problem. My /usr/local/opt where the packages are linked had permissions root:wheel. I changed permissions by doing

sudo chown -R <localuser>:staff /usr/local/opt

where of course "localuser" is your local user you used to install brew.

Then aswell I had to run

brew reinstall autoconf

and so on instead of just "install", since brew always kept on saying the lib already was installed (yet not linked). "reinstall" simply forces a new install of the package. that did the trick for me.

Hope this helps someone with similar problems.



回答6:

User which is running brew should have write access to This entire directory path

/Library/Caches/Homebrew/Formula

No need to change ownership just write permission. then running rvm works



回答7:

I was encountering similar issues, particular around the install of openssl098. I came across this Homebrew issue, tried rvm get head as suggested, and now rvm works perfectly.



回答8:

I'd try to install Xcode Command Line Tools before.