Reputation: 355
I'm new to programming trying to add Ruby 2.2 using RVM and receiving the below error. I've run rvm get stable and tried reinstalling, but getting the same error.
$ rvm reinstall ruby-2.2.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl........
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.6M 100 12.6M 0 0 892k 0 0:00:14 0:00:14 --:--:-- 1518k
ruby-2.2.0 - #extracting ruby-2.2.0 to /usr/local/rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /usr/local/rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
ruby-2.2.0 - #configuring..........................................................
ruby-2.2.0 - #post-configuration.
ruby-2.2.0 - #compiling.............................................................
ruby-2.2.0 - #installing..........
Error running '__rvm_make install',
showing last 15 lines of /usr/local/rvm/log/1420687911_ruby-2.2.0/install.log
psych 2.0.8
rake 10.4.2
rdoc 4.2.0
installing bundle gems: /usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
minitest-5.4.3.gem
power_assert-0.2.2.gem
test-unit-3.0.8.gem
./tool/rbinstall.rb:723:in `chmod': Operation not permitted @ chmod_internal - /usr/local/rvm/gems/ruby-1.9.3-p392/ (Errno::EPERM)
from ./tool/rbinstall.rb:723:in `block in <main>'
from ./tool/rbinstall.rb:749:in `call'
from ./tool/rbinstall.rb:749:in `block in <main>'
from ./tool/rbinstall.rb:746:in `each'
from ./tool/rbinstall.rb:746:in `<main>'
make: *** [do-install-nodoc] Error 1
++ return 2
There has been an error while running make install. Halting the installation.
Upvotes: 32
Views: 60811
Reputation: 53
On Mac M3, I resolved the issue by running Terminal as Rosetta as mentioned this article https://medium.com/@nelliemckesson/install-ruby-with-rvm-on-an-m3-pro-mac-784718bdb72a
Upvotes: 1
Reputation: 704
This worked for me:
arch -x86_64 rvm install 3.3.0 --with-openssl-dir=/usr/local/opt/[email protected]
Upvotes: 1
Reputation: 930
This brilliant answer on github has solved the problem for me. The solution is to simply use openssl while installing the version of ruby you wish to install. For example, to install ruby v2.7.8, run the command:
rvm install ruby-2.7.8 --with-openssl-dir=/opt/homebrew/opt/[email protected]
Upvotes: 7
Reputation: 2136
I had this error when I tried to install ruby-2.7.5. The following steps helped me install it without errors.
rvm get head
from the terminal.If this step fails, you might want to update
curl
by runningbrew install curl
brew install [email protected]
. Once done, update your .zshrc
or .zshenv
with the env variables suggested by the installation.export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
rvm install 2.7.5
PS: I also ran the following command after installing [email protected] to fix the issues with the CA certs as suggested by the installation report. /usr/local/opt/[email protected]/bin/c_rehash
Upvotes: 0
Reputation: 836
I also had to face the same problem while installation ruby's in ubutnu 22.04 I resolved by these
rvm pkg install openssl rvm install ruby-2.7.3 --with-openssl-dir=$HOME/.rvm/usr
Upvotes: 1
Reputation: 11
Having the same issue in October 2022, solved by refreshing the keys running
gpg2 --refresh-keys
Or you can try
gpg --refresh-keys
If you don't have gpg2 installed.
As RVM says in their docs:
It is a good practice to periodically refresh keys status to ensure none of them got revoked. You can also add it to cron.
Upvotes: 1
Reputation: 10582
RubyGems is more secure now and you must have openssl installed for rvm to work. rvm doesn't come with the newest openssl libs out of the box, so for now you have to add its package, and also specify the path to your openssl configuration when installing a new ruby. The nature of the error doesn't really present itself, and it's a bit of a pain when installing new rubies, but maybe this will be changed in the future.
To verify if this is your situation, if you still have access to your log file, check it to see if it is failing on the openssl library. Alternatively, you can run ruby -ropenssl -e "puts :OK"
to see if you get an error (this assumes you have a different ruby version installed you can use).
If either are true, then follow these two OS-agnostic steps:
rvm pkg install openssl
Then either
rvm install <ruby version here> --with-openssl-dir=$rvm_path/usr
or
rvm reinstall <ruby version here> --force --with-openssl-dir=$rvm_path/usr
...based on whether it was a new or pre-existing install of ruby.
Upvotes: 8
Reputation: 7043
This error got me scratching my head when installing ruby through RVM on an M1 Macbook:
Error running '__rvm_make -j10',
please read /Users/copmputer/.rvm/log/1640263012_ruby-2.4.0/make.log
There has been an error while running make. Halting the installation.
First you need to inspect the file make.log and see what the underlying error is. In my case it was:
error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
I found the complete solution to my problem on this GitHub page. Here it is:
Step 1
Run in terminal: brew info libffi
which will output the following:
For compilers to find libffi you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
For pkg-config to find libffi you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
Step 2 Run all 3 export commands in terminal to set the env variables.
Step 3 Finally, run the ruby installation command. In my case, it was:
rvm install ruby-2.4.0
That's it.
In case you're using rbenv there's another working solution in that GH thread.
Upvotes: 7
Reputation: 4248
The issue could be with an outdated version of xcode. Try updating xcode from the app store. Then run brew upgrade
. After that, you should be able to successfully install ruby with your rvm command.
Upvotes: 0
Reputation: 798
Following steps worked for me:
cd .rvm/src/ruby-x.x.x
make install
Upvotes: 0
Reputation: 7559
Try to update your rvm using command
rvm get head
Then try again. Hopefully it should work.
Upvotes: 61