several Ruby examples
-
using your terminal.
-
install
brewfrom brew.sh. -
install
rbenvusingbrew. with this:brew install rbenv. -
install last stable ruby version using
rbenv. with this:rbenv install 3.1.0. -
set your ruby version to use with
rbenv global your_version_just_installed. -
check your versions installed with
rbenv versions. yours should be selected with an*as first character. -
check your version in place with
ruby -v. -
be sure you dont have
rvminstalled. if this is the case uninstall it with these steps:rvm implodeorrm -rf ~/.rvm- And don’t forget to remove the script calls in the following files:
~/.bashrc~/.bash_profile~/.profile
- from your terminal open
irb - then type:
ruby file_name.rb