Ruby installation (2.2.2) fails in macOS Big Sur
EDIT
It looks like OP edited the error in the original message so the below answer is no longer relevant. Leaving it here for posterity.
Updated Answer
Based on discussion in a couple of Github issues on the rbenv repo,
- https://github.com/rbenv/ruby-build/issues/1480
- https://github.com/rbenv/ruby-build/issues/1489
it sounds like Apple changed the default CFLAGS
as part of xcode 12, which makes some of the native extension installations go haywire. It sounds like the solution proposed in those issues is
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.2
Original answer
The error states it failed due to issues with extensions
The Ruby readline extension was not compiled.
The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
so I would suggest trying to install those extensions manually first, then retrying the ruby install.
With brew:
brew install readline
brew install zlib
There are some issues on ruby-build
's github that might help as well:
- https://github.com/rbenv/ruby-build/issues/1076
- https://github.com/rbenv/ruby-build/issues/832#issuecomment-160906530
how to install ruby-Tk on mac OSX catalina 10.15.4, ruby-2.6.3
Below guide assumes you have Xcode already installed. If not install it first from the apple app store.
1) Install ActiveTcl for macOS from https://www.activestate.com
under applications/utilities, there will be a new app wish.app. run this app and if you get the wish console to open, then, it installed ok
2) Using your command line do the following
brew install ruby #this will install latest version of ruby
gem install tk
3) then add other ruby gems that you need for your development environment.
Unable to update Ruby on macOS Catalina version 10.15.3
First you need add gpg key.
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Then install rvm via CURL. If you don't have CURL, install it via Homebrew brew install curl
curl -sSL https://get.rvm.io | bash
then rvm list
to get installed version of ruby.
then rvm list known
to get the available version.
then rvm install 2.7.0
to install ruby 2.7.0.
then rvm --default use 2.7.0
to use it.
Related Topics
Why Is Ruby String.Hash Inconsistent Across MAChines
Problems Keeping an Object in an Array, Ruby Issues and Rails Issues
Ruby: How to Write a Bang Method, Like Map
Ruby: Is Variable Is Object in Ruby
You May Have Encountered a Bug in the Ruby Interpreter or Extension Libraries
Ruby Copy a Paperclip Attachment from One Model to Another
Alter $Path in Vim/Macvim So as to Find the Right Ruby Binary
Ruby Tcpsocket: Find Out How Much Data Is Available
Detecting Overlapping Ranges in Ruby
Trying to Set Up Amazon's S3 Bucket: 403 Forbidden Error & Setting Permissions
Parsing Date from Text Using Ruby
Best Way to Handle Category/Subcategory Relationship Ruby on Rails
Grouped Collection Select Alphabetical Order Rails
How to Deal with App_Key and App_Secret (Dropbox API)
Nokogiri Requires Ruby Version < 2.3
Rails/Activerecord: Save Changes to a Model's Associated Collections
How to Fix a Slow Implicit Query on Pg_Attribute Table in Rails