# Ruby not installing properly

**URL:** <https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564>\
**Category:** Help\
**Created:** [November 28, 2024, 4:24pm UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564 "2024-11-28T16:24:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![solochris14](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/solochris14/32/2319_2.png) [@solochris14](https://talk.jekyllrb.com/u/solochris14)\
**Post date:** [November 28, 2024, 4:24pm UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564/1 "2024-11-28T16:24:32Z")

</div>

I am trying to install Ruby on my new Mac Studio and I am running into an issue moving past the Jekyll installation steps… I seem to have the latest Ruby version but when I run a command to see which version I have, it gives me a 2022 version.

Any help greatly appreciated.

 ![Screenshot 2024-11-28 at 10.23.00](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/3/39e4f723b51be5dfa34a98e165abe766118e44c6.png)

---

<div class="post-metadata">

**Author:** ![jethrojones](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jethrojones/32/6115_2.png) [@jethrojones](https://talk.jekyllrb.com/u/jethrojones)\
**Post date:** [November 29, 2024, 5:40am UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564/2 "2024-11-29T05:40:47Z")

</div>

I had a similar issue and I had to run rbenv or chmod to get into the right version of Ruby.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [November 29, 2024, 4:48pm UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564/3 "2024-11-29T16:48:01Z")

</div>

macs seem to come with a system ruby, seems to cause lots of issues.

I think rbenv is a ruby manager that allows you to switch between different versions. Look in to what commands you can use with it - one is probably list to see what versions are available and then there should be a way to tell it which one you want to set it to?

---

<div class="post-metadata">

**Author:** ![george-gca](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/george-gca/32/5301_2.png) [@george-gca](https://talk.jekyllrb.com/u/george-gca)\
**Post date:** [November 30, 2024, 2:51am UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564/4 "2024-11-30T02:51:05Z")

</div>

I wrote about installing Ruby with `rbenv` in a post in [my blog](https://george-gca.github.io/blog/2022/running-local-al-folio/), but sharing the useful part here. Note that this is for linux, so some adaptations might be needed.

* * *

For those familiar with Python, `rbenv` is similar to `pyenv`. To install `rbenv`, run the following commands:

```auto
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src

```

This will download the `rbenv` repository to your home directory, and then compile it. Next, add the following lines to your `~/.bashrc` file:

```auto
# enable rbenv
if [-d "$HOME/.rbenv/"]; then
    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init - bash)"
fi

```

Then, restart your terminal or run `. ~/.bashrc` to reload your bash settings. This will make the `rbenv` command available in your terminal. To test if this is working properly, run `curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash`. It should output something similar to this:

```auto
Checking for `rbenv' in PATH: /home/gca/.rbenv/bin/rbenv
Checking for rbenv shims in PATH: Not found
Checking `rbenv install' support: /home/gca/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20220910.1-10-gecb9d22)
Counting installed Ruby versions: 1 versions
Auditing installed plugins: OK

```

It will display an error in line `Checking for rbenv shims in PATH`. Don’t worry, this will be fixed. Next, you need to install [ruby-build](https://github.com/rbenv/ruby-build) as a `rbenv` plugin, so you can easily download and install different versions of Ruby. To do so, run the following commands:

```auto
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

```

To check which versions of Ruby are available to install, simply run `rbenv install --list`. You can install any version you want, but I recommend installing the latest stable version. At the time of writing, it is version 3.1.2. To install it, you need first to install the ssl dependency and then the Ruby version.

```auto
sudo apt install -y libssl-dev
rbenv install 3.1.2

```

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [December 2, 2024, 4:09pm UTC](https://talk.jekyllrb.com/t/ruby-not-installing-properly/9564/5 "2024-12-02T16:09:57Z")

</div>

Because macOS comes with its own (old) version of Ruby, Homebrew does not automatically put Homebrew-Ruby on its default path (i.e. Ruby is a “keg-only” in Homebrew parlance).

When you install/re-install ruby, Homebrew will provide instructions for how to add its Ruby to the path. Below is an example re-install. Note that the exact details will vary depending on your OS/processor/shell/etc:

```shell
% brew reinstall ruby
...
==> Pouring ruby--3.3.6.sonoma.bottle.tar.gz
==> Caveats
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/3.3.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH, run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

```
