Ruby

audience developer
level all
topic Ruby
subtopic Installation

Troubleshooting

Here is help if you’ve encountered issues installing or running Ruby.

asdf "No version set for command"

If you see "No version set for command" like this:

$ ruby -v
No version set for command node
Consider adding one of the following versions in your config file at
ruby 3.4.1

You need to specify a default version of the language in your home ~/.tool-versions file.

You can set the ~/.tool-versions file with a command:

$ asdf global ruby 3.4.1

Your ~/.tool-versions file will look like this:

ruby 3.4.1

Gem pristine warning

If you get a warning, Ignoring ... because its extensions are not built. Try: gem pristine ...:

Close and re-open the terminal window to start a new terminal session and try again.

Conflicting bundler versions (with Rails)

If you install a version of Bundler that is newer than the default installed with Ruby, you will get a message Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4) when you run a Rails command. You can avoid the warning by prepending bundle exec, for example bundle exec rails -T. It's not possible to remove a default gem with gem uninstall bundler so it's advisable not to install a newer version of Bundler unless absolutely necessary.

Problems with "Gem::RemoteFetcher::FetchError: SSL_connect"

Ruby and RubyGems (starting with Ruby 1.9.3p194 and RubyGems 1.8.23) require verification of server SSL certificates when Ruby makes an Internet connection via https. If you run rails new and get an error Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate see this article suggesting solutions: OpenSSL errors and Rails.

Problems with "Certificate Verify Failed"

Are you getting an error OpenSSL certificate verify failed when you try to generate a new Rails app from an application template? See this article suggesting solutions: OpenSSL errors and Rails.

Installing in a second account

If you've created a second user account on your Mac, and the first user has already installed Homebrew, the first user may have to change permissions for the /usr/local/bin and /usr/local/Cellar folders:

$ sudo chmod g+w /usr/local/bin
$ sudo chmod g+w /usr/local/Cellar

The second user account should be given admin privileges using the System Preferences "Users and Groups" setting.