Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 689 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rbenv not changing ruby version

#31
I tried every solution, but nothing worked for me. Even I was including the path in the `.zshrc` file.

In my case, I'm using `MacBook Pro M2` with macOS `Ventura 13.2`. And I'm using `React Native 0.71.2`, which needed Ruby `2.7.6` version.

I simply placed the following code in the `.zprofile` instead of `.zshrc`, and it worked:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"
Reply

#32
## Update 2023 (Macbook Ventura+)

Even if you have `rbenv` installed, your computer could still serve the default ruby version. To fix this, just run the following:

```bash
rbenv init
```

This might give an output like this:

```bash
# Load rbenv automatically by appending
# the following to ~/.zshrc:

eval "$(rbenv init - zsh)"
```

Just open your `.zshrc` file:
```bash
sudo nano ~/.zshrc
```
(Or you can also open this file with any other text editor)

Add this line:
```bash
eval "$(rbenv init - zsh)"
```

Save the file (if used sudo nano, you can do so like this:)
`CTRL + X` then `Y` then `Enter` (For Mac)

Now, refresh your `.zshrc` profile like this:
```bash
source ~/.zshrc
```

Now type `ruby --version`, this must give you the ruby version that was provided by `rbenv`.
Reply

#33
HOW TO INSTALL RUBY RBENV
Just like many other tools, we turn to the popular Homebrew macOS package manager. Run the following command in your terminal:

brew install rbenv ruby-build

Once everything is installed, we need to instruct rbenv to setup our shell, so we’re using the Ruby runtime version that we’ve customly installed with rbenv whenever we open a new terminal window to type commands in the prompt (as opposed to the preinstalled Ruby 2.6.8 version on the macOS).

To setup rbenv with your shell run the following command:

rbenv init

Follow the on-screen printed instructions if any extra configuration is required on your part. You might be asked to paste a command in your shell’s configuration. If you’re on a macOS and haven’t changed from the default Z Shell (ZSH), then you’ll want to make sure you add the following line of code to the top of your ~/.zshrc file:

eval "$(rbenv init - zsh)"

The rbenv install process is now complete. You might want to run some diagnostic checks to ensure that everything is set up correctly. If so, you can run the rbenv-doctor tool that the rbenv GitHub project provides:

Open a new terminal window so that you have the new rbenv environment loaded
Run the command:
curl -fsSL

[To see links please register here]

| zsh
Warning: This command shouldn’t be taken lightly, as you are piping commands into your development environment’s shell that originate from a public and open source GitHub repository. It is possible that a malicious actor had tampered with the source code, so you are highly encouraged to review the code properly before you run this command.

How do you use rbenv to install a new Ruby version?
Congrats on building your own Ruby virtual environment! Now that you have a functional rbenv setup we can use it to completely manage your Ruby versions.

To begin, you want to list which Ruby versions are available for installation so you can choose the latest Ruby release, or perhaps a specific version that you’re looking for. To use rbenv to list all Ruby versions, run the following command:

rbenv install -l

The output of which was:

2.6.10
2.7.6
3.0.4
3.1.2
jruby-9.3.6.0
mruby-3.1.0
picoruby-3.0.0
rbx-5.0
truffleruby-22.1.0
truffleruby+graalvm-22.1.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.
You can then proceed to installing one of these Ruby versions. Let’s use rbenv to install a Ruby version of 3.1.2:

rbenv install 3.1.2

The command will then start fetching the relevant source code files to extract, compile, and then install the Ruby 3.1.2 runtime version available to your shell.

When you’ve finished installing it, you should set it to be the chosen version anytime your shell starts. To do that, you need to run:

rbenv global 3.1.2

Finally, you can verify that this is working as expected by running the ruby --version in your shell, which should output a similar result:







Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through