Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amit352/66bfe076c7ce964d2b8ca271a130a2fc to your computer and use it in GitHub Desktop.
Save amit352/66bfe076c7ce964d2b8ca271a130a2fc to your computer and use it in GitHub Desktop.

Revisions

  1. @MarkBennett MarkBennett revised this gist Nov 28, 2022. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion installing-ruby-2.5.1-on-m1.md
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,12 @@ Then I ran this command:

    ```
    RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5
    ```
    ```

    I haven't been able to test this yet, but @samik3k has reported that this no longer works, but that the following command does.

    ```
    RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC rbenv install 2.5.8
    ```

    Please reply and let me know if this works for you and I'll update the steps above as I don't have Ruby setup on my M1 Mac right now.
  2. @MarkBennett MarkBennett created this gist Mar 31, 2021.
    35 changes: 35 additions & 0 deletions installing-ruby-2.5.1-on-m1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    I was able to get Ruby 2.5.1 building on M1 by following two of the steps in that GH issue...

    https://github.com/rbenv/ruby-build/issues/1691#issuecomment-756272951
    https://github.com/rbenv/ruby-build/issues/1691#issuecomment-772224551

    I installed `readline` and `openssl` with standard `brew install`.

    ```bash
    brew install readline
    brew install openssl
    ```

    Then I set this in my `~/.zshrc`..

    ```
    # Homebrew
    export PATH=/opt/homebrew/bin:$PATH
    export PATH="/opt/homebrew/sbin:$PATH"
    # rbenv
    export RBENV_ROOT=/opt/homebrew/opt/rbenv
    export PATH=$RBENV_ROOT/bin:$PATH
    eval "$(rbenv init -)"
    # openssl
    export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
    export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
    export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
    export PKG_CONFIG_PATH="/opt/homebrew/opt/[email protected]/lib/pkgconfig"
    export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/[email protected]"
    ```

    Then I ran this command:

    ```
    RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5
    ```