I am trying to uninstall ruby and start over. I am can't get fastlane to work because of all the ruby errors - can't find installed gems, etc. I don't code in ruby and have not used gems before this.
So how do I really start fresh?
Environment:
I am on Big Sur
Installed ruby with brew
Added packages with gem
I have a local Gemfile that looked like
gem "dotenv"
gem "fastlane"
I did this:
% gem uninstall -aIx
INFO: Uninstalled all gems in
and
gem clean
Cleaning up installed gems...
Clean up complete
It looks like it should be showing me a folder here. Not sure if that's a clue.
I also blanked my Gemfile and did
bundle clean --force
Now when I do gem list I still have local gems
% gem list
*** LOCAL GEMS ***
bigdecimal (default: 1.4.1)
bundler (default: 1.17.2)
CFPropertyList (2.3.6)
cmath (default: 1.0.0)
csv (default: 3.0.9)
date (default: 2.0.0)
dbm (default: 1.0.0)
e2mmap (default: 0.1.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
json (default: 2.1.0)
libxml-ruby (3.1.0)
logger (default: 1.3.0)
matrix (default: 0.1.0)
mini_portile2 (2.4.0)
mutex_m (default: 0.1.0)
nokogiri (1.10.1)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
prime (default: 0.1.0)
psych (default: 3.1.0)
rdoc (default: 6.1.0)
rexml (default: 3.1.9)
rss (default: 0.2.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
shell (default: 0.7)
sqlite3 (1.3.13)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
thwait (default: 0.1.0)
tracer (default: 0.1.0)
webrick (default: 1.4.2)
zlib (default: 1.0.0)
I also see gems in all of the folders listed by gem env
- /Users/me/.gem/ruby/2.6.0
- /Library/Ruby/Gems/2.6.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
Related
I am fairly new to using Ruby, Rubygems, jekyll, bundler, and the like. It's not my area of knowledge. But I know enough regarding how to use the terminal to get around this lack of knowledge.
I have Ruby 3.0.0 installed, but for some reason, I get the following in terminal when I run jekyll.
I run:
jekyll new blog
and get the following:
/Library/Ruby/Site/2.6.0/rubygems.rb:281:in `find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.6.0/rubygems.rb:300:in `activate_bin_path'
from /usr/local/bin/jekyll:23:in `<main>'
These are my local gems:
*** LOCAL GEMS ***
abbrev (default: 0.1.0)
base64 (default: 0.1.0)
benchmark (default: 0.1.1)
bigdecimal (default: 3.0.0)
bundler (default: 2.4.6)
bundler-unload (1.0.2)
cgi (default: 0.2.0)
concurrent-ruby (1.2.0)
csv (default: 3.1.9)
date (default: 3.1.0)
dbm (default: 1.1.0)
debug (default: 0.1.0)
delegate (default: 0.2.0)
did_you_mean (default: 1.5.0)
digest (default: 3.0.0)
drb (default: 2.0.4)
english (default: 0.7.1)
erb (default: 2.2.0)
etc (default: 1.2.0)
executable-hooks (1.6.1)
fcntl (default: 1.0.0)
ffi (1.15.5)
fiddle (default: 1.0.6)
fileutils (default: 1.5.0)
find (default: 0.1.0)
forwardable (default: 1.3.2)
forwardable-extended (2.6.0)
gem-wrappers (1.4.0)
getoptlong (default: 0.1.1)
http_parser.rb (0.8.0)
i18n (1.12.0)
io-console (default: 0.5.6)
io-nonblock (default: 0.1.0)
io-wait (default: 0.1.0)
ipaddr (default: 1.2.2)
irb (default: 1.3.0)
jekyll-sass-converter (2.2.0)
jekyll-watch (2.2.1)
json (default: 2.5.1)
kramdown (2.4.0)
kramdown-parser-gfm (1.1.0)
liquid (4.0.4)
listen (3.8.0)
logger (default: 1.4.3)
matrix (default: 0.3.1)
mercenary (0.4.0)
minitest (5.14.2)
mutex_m (default: 0.1.1)
net-ftp (default: 0.1.1)
net-http (default: 0.1.1)
net-imap (default: 0.1.1)
net-pop (default: 0.1.1)
net-protocol (default: 0.1.0)
net-smtp (default: 0.2.1)
nkf (default: 0.1.0)
observer (default: 0.1.1)
open-uri (default: 0.1.0)
open3 (default: 0.1.1)
openssl (default: 2.2.0)
optparse (default: 0.1.0)
ostruct (default: 0.3.1)
pathname (default: 0.1.0)
pathutil (0.16.2)
power_assert (1.2.0)
pp (default: 0.1.0)
prettyprint (default: 0.1.0)
prime (default: 0.1.2)
pstore (default: 0.1.1)
psych (default: 3.3.0)
racc (default: 1.5.1)
rake (13.0.3)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rbs (1.0.0)
rdoc (default: 6.3.0)
readline (default: 0.0.2)
readline-ext (default: 0.1.1)
reline (default: 0.2.0)
resolv (default: 0.2.0)
resolv-replace (default: 0.1.0)
rexml (3.2.4)
rinda (default: 0.1.0)
rouge (3.30.0)
rss (0.2.9)
rubygems-bundler (1.4.5)
rubygems-update (3.4.6)
rvm (1.11.3.9)
safe_yaml (1.0.5)
sassc (2.4.0)
securerandom (default: 0.1.0)
set (default: 1.0.1)
shellwords (default: 0.1.0)
singleton (default: 0.1.1)
stringio (default: 3.0.0)
strscan (default: 3.0.0)
syslog (default: 0.1.0)
tempfile (default: 0.1.1)
terminal-table (2.0.0)
test-unit (3.3.7)
time (default: 0.1.0)
timeout (default: 0.1.1)
tmpdir (default: 0.1.1)
tracer (default: 0.1.1)
tsort (default: 0.1.0)
typeprof (0.11.0)
un (default: 0.1.0)
unicode-display_width (1.8.0)
uri (default: 0.10.1)
weakref (default: 0.1.1)
webrick (1.8.1)
yaml (default: 0.1.1)
zlib (default: 1.1.0)
I'm trying to create a static website for my portfolio.
Thanks!
Apologies if this question isn't formatted too well.
I'm working through The Odin Project right now and am now doing the Ruby path (really liked how data structures and algorithms would be included)
Right now, the section I'm working on is the debugging in VScode. The first step was to run the command:
gem install debug
But upon doing this, the command merely brings that process to the foreground without really executing anything.
I checked my gems and whether they needed updated, but even commands like
gem update
gem outdated
didn't work.
What should I do to address this issue?
Going further into detail with what I tried above, those commands simply did the same thing.
gem update
gem outdated
These both started in the foreground without actually doing anything.
The command below worked for me, and it printed the following after it
gem list
*** LOCAL GEMS ***
abbrev (default: 0.1.0)
base64 (default: 0.1.1)
benchmark (default: 0.2.0)
bigdecimal (default: 3.1.1)
bundler (2.3.14, default: 2.3.7)
byebug (11.1.3)
cgi (default: 0.3.1)
coderay (1.1.3)
csv (default: 3.2.2)
date (default: 3.2.2)
debug (1.4.0)
delegate (default: 0.2.0)
did_you_mean (default: 1.6.1)
diff-lcs (1.5.0)
digest (default: 3.1.0)
drb (default: 2.1.0)
english (default: 0.7.1)
erb (default: 2.2.3)
error_highlight (default: 0.3.0)
etc (default: 1.3.0)
fcntl (default: 1.0.1)
fiddle (default: 1.1.0)
fileutils (default: 1.6.0)
find (default: 0.1.1)
forwardable (default: 1.3.2)
getoptlong (default: 0.1.1)
io-console (default: 0.5.11)
io-nonblock (default: 0.1.0)
io-wait (default: 0.2.1)
ipaddr (default: 1.2.4)
irb (default: 1.4.1)
json (default: 2.6.1)
logger (default: 1.5.0)
matrix (0.4.2)
method_source (1.0.0)
minitest (5.15.0)
mutex_m (default: 0.1.1)
net-ftp (0.1.3)
net-http (default: 0.2.0)
net-imap (0.2.3)
net-pop (0.1.1)
net-protocol (default: 0.1.2)
net-smtp (0.3.1)
nkf (default: 0.1.1)
observer (default: 0.1.1)
open-uri (default: 0.2.0)
open3 (default: 0.1.1)
openssl (default: 3.0.0)
optparse (default: 0.2.0)
ostruct (default: 0.5.2)
pathname (default: 0.2.0)
power_assert (2.0.1)
pp (default: 0.3.0)
prettyprint (default: 0.1.1)
prime (0.1.2)
pry (0.14.1)
pry-byebug (3.10.1)
pstore (default: 0.1.1)
psych (default: 4.0.3)
racc (default: 1.6.0)
rake (13.0.6)
rbs (2.1.0)
rdoc (default: 6.4.0)
readline (default: 0.0.3)
readline-ext (default: 0.1.4)
reline (default: 0.3.0)
resolv (default: 0.2.1)
resolv-replace (default: 0.1.0)
rexml (3.2.5)
rinda (default: 0.1.1)
rspec (3.11.0)
rspec-core (3.11.0)
rspec-expectations (3.11.0)
rspec-mocks (3.11.1)
rspec-support (3.11.0)
rss (0.2.9)
ruby2_keywords (default: 0.0.5)
securerandom (default: 0.1.1)
set (default: 1.0.2)
shellwords (default: 0.1.0)
singleton (default: 0.1.1)
stringio (default: 3.0.1)
strscan (default: 3.0.1)
syslog (default: 0.1.0)
tempfile (default: 0.1.2)
test-unit (3.5.3)
time (default: 0.2.0)
timeout (default: 0.2.0)
tmpdir (default: 0.1.2)
tsort (default: 0.1.0)
typeprof (0.21.2)
un (default: 0.2.0)
uri (default: 0.11.0)
weakref (default: 0.1.1)
yaml (default: 0.2.0)
zlib (default: 2.1.1)
What are some other things I can do to debug this issue?
For full transparency, I started learning about Cucumber an hour ago. I've been following a concise tutorial on using Selenium in Ruby with Cucumber and I've had no issues until this point.
In essence, I'm trying to run a test scenario(?) but I am receiving this error:
C:\Ruby27-x64\bin\ruby.exe -EUTF-8 C:\Ruby27-x64\bin\cucumber C:/Users/kanwo/RubymineProjects/untitled/features/1.feature --format Teamcity::Cucumber::Formatter --expand --color -r features
Testing started at 7:09 am ...
wrong number of arguments (given 1, expected 2)
Error creating formatter: Teamcity::Cucumber::Formatter (ArgumentError)
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:12:in `ensure_io'
C:/Program Files/JetBrains/RubyMine 2020.3.2/plugins/ruby/rb/testing/patch/bdd/teamcity/cucumber/cucumber_4_formatter.rb:20:in `initialize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:30:in `new'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:30:in `new'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:206:in `create_formatter'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:195:in `block in formatters'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:209:in `block in formatter_factories'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:207:in `map'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:207:in `formatter_factories'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:194:in `formatters'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:174:in `report'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:76:in `run!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/cli/main.rb:29:in `execute!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/bin/cucumber:9:in `<top (required)>'
C:/Ruby27-x64/bin/cucumber:23:in `load'
C:/Ruby27-x64/bin/cucumber:23:in `<main>'
Errors are usually pretty straight-forward but I don't feel I know enough about frameworks(? again, bare with me as I've just jumped into this) so I did some research and found that this has been an issue for a while, as per these instances:
This first link is ugly, you've been warned
2015, Instance 1
2015, Instance 2
2015, Instance 3
2018, Instance 4
2020, Instance 5
2021, Instance 6
2021, 9 days ago, Instance 7
Granted, these aren't all exactly the same error(s) as mine, but they seem to share a theme; versions.
So from my understanding, this is a conflict between versions of Cucumber, RubyMine, and TeamCity.
With that said, am I essentially out of luck here? Can I perform this in something like VSCode instead? I don't like to just dump questions into forums if I don't have to but I can't even begin to know where to start to figure this out.
Also, if it helps, this is what I was running:
Feature: Feature Name
Scenario: Logging in
Given I am on the login page
When I enter my password correctly
Then I will be logged in and provided a confirmation
and these are my local gems:
activesupport (6.1.3)
ast (2.4.2)
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
builder (3.2.4)
bundler (default: 2.1.4)
cgi (default: 0.1.0)
childprocess (3.0.0)
concurrent-ruby (1.1.8)
csv (default: 3.1.2)
cucumber (5.3.0)
cucumber-core (8.0.1)
cucumber-create-meta (2.0.4)
cucumber-cucumber-expressions (10.3.0)
cucumber-gherkin (15.0.2)
cucumber-html-formatter (9.0.0)
cucumber-messages (13.2.1)
cucumber-tag-expressions (2.0.4)
cucumber-wire (4.0.1)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
diff-lcs (1.4.4)
etc (default: 1.1.0)
fcntl (default: 1.0.0)
ffi (1.15.0 x64-mingw32)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
gdbm (default: 2.1.0)
getoptlong (default: 0.1.0)
i18n (1.8.9)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
irb (default: 1.2.6)
jar_wrapper (0.1.8)
json (default: 2.3.0)
logger (default: 1.4.2)
matrix (default: 0.2.0)
middleware (0.1.0)
minitest (5.13.0)
multi_test (0.1.2)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
net-telnet (0.2.0)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.2.0)
parallel (1.20.1)
parser (3.0.0.0)
power_assert (1.1.7)
prime (default: 0.1.1)
protobuf-cucumber (3.10.8)
pstore (default: 0.1.0)
psych (default: 3.1.0)
racc (default: 1.4.16)
rainbow (3.0.0)
rake (13.0.1)
rdoc (default: 6.2.1)
readline (default: 0.0.2)
regexp_parser (2.1.1)
reline (default: 0.1.5)
rexml (default: 3.2.3)
rss (default: 0.2.8)
rubocop (1.11.0)
rubocop-ast (1.4.1)
ruby-progressbar (1.11.0)
rubyzip (2.3.0)
sdbm (default: 1.0.0)
selenium (0.2.11)
selenium-webdriver (3.142.7)
singleton (default: 0.1.0)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
sys-uname (1.2.2)
test-unit (3.3.4)
thor (1.1.0)
thread_safe (0.3.6)
timeout (default: 0.1.0)
tracer (default: 0.1.0)
tzinfo (2.0.4)
unicode-display_width (2.0.0)
uri (default: 0.10.0)
webrick (default: 1.6.0)
xmlrpc (0.3.0)
yaml (default: 0.1.0)
zeitwerk (2.4.2)
zip (2.0.2)
zlib (default: 1.1.0)
Any insight is appreciated!
This is a RubyMine bug. Nothing we can fix on the Cucumber end.
You can either consult a non-recommended monkeypatch / hack. Or downgrade to an early version of Cucumber5.
See https://youtrack.jetbrains.com/issue/RUBY-27294 for more information, including other possible workarounds and a time-frame for the fix from Jetbrains.
Luke - Cucumber Ruby committer.
I faced same issue but solved by updating Run settings in RubyMine as per below steps:
Run->Edit Configurations->Templates->Cucumber->Configuration-> Runner Options as "--color -r features -f pretty"
I'm having an issue with rbenv and what I believe is an issue is of require trying to read from my system gems rather than from shims.
I'm trying to create a single script file without the overhead of needing bundle - though I've tried adding a Gemfile and put the script and Gemfile in the same directory.
Reproducible steps:
brew install rbenv
export PATH="$HOME/.rbenv/bin:$PATH" in my .zshrc
Add eval "$(rbenv init -)" to my .zshrc
Source: . ~/.zshrc
rbenv install 2.6.3
rbenv rehash
rbenv global 2.6.3
rbenv rehash for brevity
Close terminal
New terminal:
ruby -v = "ruby 2.6.3p62"
rbenv version = "2.6.3 (set by $HOME/Desktop/.ruby-version)"
which ruby = "$HOME/.rbenv/shims/ruby"
gem env
INSTALLATION DIRECTORY: $HOME/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0
USER INSTALLATION DIRECTORY: $HOME/.gem/ruby/2.6.0
RUBY EXECUTABLE: $HOME/.rbenv/versions/2.6.3/bin/ruby
EXECUTABLE DIRECTORY: $HOME/.rbenv/versions/2.6.3/bin
SPEC CACHE DIRECTORY: $HOME/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: $HOME/.rbenv/versions/2.6.3/etc
RUBYGEMS PLATFORMS:
ruby
x86_64-darwin-18
GEM PATHS:
$HOME/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0
$HOME/.gem/ruby/2.6.0
gem install colorize - this gem seems to work fine
gem install httparty
gem install pry
File header:
#!/usr/bin/ruby
require 'httparty'
require 'colorize'
require 'pry'
./file.rb
Stack Trace for HTTParty
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in 'to_specs': Could not find 'multi_xml' (>= 0.5.2) among 17 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=$HOME/.gem/ruby/2.3.0:/Library/Ruby/Gems/2.3.0:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0', execute `gem env` for more information
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1442:in `block in activate_dependencies'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1431:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1431:in `activate_dependencies'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1413:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:196:in `rescue in try_activate'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:193:in `try_activate'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:125:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from ./cdw-demo.rb:3:in `<main>'
Stack trace for Pry
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- pry (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from ./cdw-demo.rb:4:in `<main>'
The stack trace shows there maybe in issue with multi_xml being a missing gem, but that was installed with httparty
Gem list:
gem list
*** LOCAL GEMS ***
bigdecimal (default: 1.4.1)
bundler (2.1.4, default: 1.17.2)
cmath (default: 1.0.0)
coderay (1.1.2)
colorize (0.8.1)
csv (default: 3.0.9)
date (default: 2.0.0)
dbm (default: 1.0.0)
did_you_mean (1.3.0)
e2mmap (default: 0.1.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
gdbm (default: 2.0.0)
httparty (0.17.3)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
json (default: 2.1.0)
logger (default: 1.3.0)
matrix (default: 0.1.0)
method_source (0.9.2)
mime-types (3.3.1)
mime-types-data (3.2019.1009)
minitest (5.11.3)
multi_xml (0.6.0)
mutex_m (default: 0.1.0)
net-telnet (0.2.0)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
power_assert (1.1.3)
prime (default: 0.1.0)
pry (0.12.2)
psych (default: 3.1.0)
rake (12.3.2)
rdoc (default: 6.1.0)
rexml (default: 3.1.9)
rss (default: 0.2.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
shell (default: 0.7)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
test-unit (3.2.9)
thwait (default: 0.1.0)
tracer (default: 0.1.0)
webrick (default: 1.4.2)
xmlrpc (0.3.0)
zlib (default: 1.0.0)
Let me know if anymore information is needed.
Rather than using /usr/bin/ruby which is the system installed Ruby, use the hashbang
#!/usr/bin/env ruby
This should point to your global rbenv backed Ruby.
I tried to study Ruby on Rails and followed a tutorial. However, I think I missed a part and I can't proceed to the next step in the tutorial, so I plan to uninstall things, including the gems I installed, and start all over again.
I installed Ruby using Homebrew, because people say it's best not to mess with the Ruby that comes with macOS. Then, I uninstalled it again using brew uninstall ruby.
After doing that, I ran gem list and this came out:
*** LOCAL GEMS ***
- bigdecimal (1.2.0)
- builder (3.2.2)
- CFPropertyList (2.2.8)
- io-console (0.4.2)
- json (1.7.7)
- libxml-ruby (2.6.0)
- minitest (4.3.2)
- nokogiri (1.5.6)
- psych (2.0.0)
- rake (0.9.6)
- rdoc (4.0.0)
- sqlite3 (1.3.7)
- test-unit (2.0.0.0)
- thor (0.19.1)
What are the gems (if any) that come with macOS system Ruby?
My fresh El Capitan gives:
*** LOCAL GEMS ***
bigdecimal (1.2.0)
CFPropertyList (2.2.8)
io-console (0.4.2)
json (1.7.7)
libxml-ruby (2.6.0)
minitest (4.3.2)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.7)
test-unit (2.0.0.0)
which is the same as #jsejcksn mentioned. For macOS 10.13.6 (High Sierra) and 10.14.5 (Mojave) the list is
*** LOCAL GEMS ***
bigdecimal (1.2.8)
CFPropertyList (2.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3.1)
libxml-ruby (2.9.0)
minitest (5.8.5)
net-telnet (0.1.1)
nokogiri (1.5.6)
power_assert (0.2.6)
psych (2.1.0.1)
rake (10.4.2)
rdoc (4.2.1)
sqlite3 (1.3.11)
test-unit (3.1.5)
As addendum, for anybody else wondering what the current default Gems on macOS 10.13.3 are:
*** LOCAL GEMS ***
bigdecimal (1.2.8)
CFPropertyList (2.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
libxml-ruby (2.9.0)
minitest (5.8.5)
net-telnet (0.1.1)
nokogiri (1.5.6)
power_assert (0.2.6)
psych (2.1.0)
rake (10.4.2)
rdoc (4.2.1)
sqlite3 (1.3.11)
test-unit (3.1.5)
Shipped gem version is 2.5.2.
macOS 12.0.1 Monterey
% gem list
*** LOCAL GEMS ***
bigdecimal (default: 1.4.1)
bundler (default: 1.17.2)
CFPropertyList (2.3.6)
cmath (default: 1.0.0)
csv (default: 3.0.9)
date (default: 2.0.0)
dbm (default: 1.0.0)
did_you_mean (1.3.0)
e2mmap (default: 0.1.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
json (default: 2.1.0)
libxml-ruby (3.2.1)
logger (default: 1.3.0)
matrix (default: 0.1.0)
mini_portile2 (2.4.0)
minitest (5.11.3)
mutex_m (default: 0.1.0)
net-telnet (0.2.0)
nokogiri (1.10.1)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
power_assert (1.1.3)
prime (default: 0.1.0)
psych (default: 3.1.0)
rake (12.3.3)
rdoc (default: 6.1.2.1)
rexml (default: 3.1.9.1)
rss (default: 0.2.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
shell (default: 0.7)
sqlite3 (1.3.13)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
test-unit (3.2.9)
thwait (default: 0.1.0)
tracer (default: 0.1.0)
webrick (default: 1.4.4)
xmlrpc (0.3.0)
zlib (default: 1.0.0)
OS X 10.10 has Ruby 2.0 has the default version, so I guess 10.11 is the same.
However, I would suggest you to use Ruby 2.3.0, because it is the most current stable version.
Since you are using brew, you can use the following code:-
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.3.0
rbenv global 2.3.0
ruby -v
Reference: https://gorails.com/setup/osx/10.11-el-capitan
UPDATE: latest stable should be 2.3.0 instead of 2.2.3. Thanks spikermann for pointing out.