tag:help.rubygems.org,2010-01-19:/discussions/problems/22905-getting-invalid-argument-for-almost-every-command-i-run-with-gemRubyGems.org: Discussion 2016-09-29T23:53:42Ztag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T21:23:04Z2016-09-29T21:23:04ZGetting "Invalid argument" for almost every command I run with gem<div><p>Can you run with <code>--backtrace</code> and/or
<code>--debug</code>?</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T23:02:53Z2016-09-29T23:02:53ZGetting "Invalid argument" for almost every command I run with gem<div><p>Sure... Here's the output:</p>
<p>$ sudo gem install xcodeproj --backtrace --debug NOTE: Debugging
mode prints all exceptions even when rescued<br>
Exception <code>LoadError' at
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:171 -
LoadError Exception</code>Errno::EINVAL' at
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672 -
Invalid argument<br>
ERROR: While executing gem ... (Errno::EINVAL)<br>
Invalid argument
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in
<code>clock_gettime'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in</code>request'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:531:in
<code>block in fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1103:in</code>block
(3 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in
<code>each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in</code>block
(2 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in
<code>each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in</code>block
in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in
<code>each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in</code>resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:522:in
<code>fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:512:in</code>each_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:493:in
<code>getresource'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/remote_fetcher.rb:105:in</code>api_endpoint'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/source.rb:47:in
<code>api_uri'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/source.rb:86:in</code>dependency_resolver_set'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/resolver/best_set.rb:24:in
<code>block in pick_sets'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/source_list.rb:98:in</code>each'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/source_list.rb:98:in
<code>each_source'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/resolver/best_set.rb:23:in</code>pick_sets'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/resolver/best_set.rb:29:in
<code>find_all'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/resolver/installer_set.rb:156:in</code>find_all'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/resolver/installer_set.rb:55:in
<code>add_always_install'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:474:in</code>resolve_dependencies'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/commands/install_command.rb:194:in
<code>install_gem'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/commands/install_command.rb:255:in</code>block
in install_gems'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/commands/install_command.rb:251:in
<code>each'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/commands/install_command.rb:251:in</code>install_gems'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/commands/install_command.rb:158:in
<code>execute'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/command.rb:310:in</code>invoke_with_build_args'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/command_manager.rb:169:in
<code>process_args'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/command_manager.rb:139:in</code>run'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/gem_runner.rb:55:in
<code>run' /usr/local/bin/gem:21:in</code>'</p>
<p>Also, here's gem env:</p>
<p>$ gem env RubyGems Environment:<br>
- RUBYGEMS VERSION: 2.6.7 - RUBY VERSION: 2.3.1 (2016-04-26
patchlevel 112) [x86_64-darwin15] - INSTALLATION DIRECTORY:
/usr/local/lib/ruby/gems/2.3.0 - USER INSTALLATION DIRECTORY:
/Users/cmermingas/.gem/ruby/2.3.0 - RUBY EXECUTABLE:
/usr/local/opt/ruby/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/cmermingas/.gem/specs - SYSTEM
CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.3.1_1/etc -
RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-15 - GEM PATHS: -
/usr/local/lib/ruby/gems/2.3.0 - /Users/cmermingas/.gem/ruby/2.3.0
- /usr/local/Cellar/ruby/2.3.1_1/lib/ruby/gems/2.3.0 - GEM
CONFIGURATION: - :update_sources => true - :verbose => true -
:backtrace => false - :bulk_threshold => 1000 - REMOTE
SOURCES: - <a href="https://rubygems.org/">https://rubygems.org/</a> - SHELL PATH: -
/usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin -
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/ -
/Applications/Postgres.app/Contents/Versions/latest/bin</p></div>Carlos Mermingastag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T23:11:55Z2016-09-29T23:11:55ZGetting "Invalid argument" for almost every command I run with gem<div><p>I see this ruby is <code>x86_64-darwin-15</code>, I'm guessing
you haven't rebuilt it on macOS Sierra? Can you try?</p>
<p>I'm guessing that will fix it because the <a href="https://github.com/ruby/ruby/blob/v2_3_1/lib/resolv.rb#L672">line
that is raising</a> is using <a href="https://github.com/ruby/ruby/blob/v2_3_1/process.c#L7794">Process::CLOCK_MONOTONIC</a>
which may not be ABI compatible across OS versions.</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T23:25:04Z2016-09-29T23:25:07ZGetting "Invalid argument" for almost every command I run with gem<div><p>Hi Eric,</p>
<p>I have OS X El Capitan 10.11.6 and I installed Ruby with "brew
install ruby" following instructions here: <a href="https://www.ruby-lang.org/en/documentation/installation/#homebrew">
https://www.ruby-lang.org/en/documentation/installation/#homebrew</a></p>
<p>To make sure I understand your recommendation: do you want me to
update the OS to macOS Sierra?</p></div>Carlos Mermingastag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T23:50:17Z2016-09-29T23:50:19ZGetting "Invalid argument" for almost every command I run with gem<div><p>Hi Eric,</p>
<p>I reached a resolution through Stack Overflow. Check it out here
if you'd like:</p>
<p><a href="http://stackoverflow.com/questions/39779854/ruby-gem-show-invalid-argument-error-for-almost-every-command/39781451">
http://stackoverflow.com/questions/39779854/ruby-gem-show-invalid-a...</a></p>
<p>Basically, I uninstalled ruby with brew and reinstalled it with
rbenv, then it all worked fine. Others commented that they started
to have this problem after updating homebrew today. Maybe this can
help you get to the root of the issue.</p></div>Carlos Mermingastag:help.rubygems.org,2010-01-19:Comment/408738432016-09-29T23:53:41Z2016-09-29T23:53:41ZGetting "Invalid argument" for almost every command I run with gem<div><p>I think I got my wires crossed on El Capitan vs Sierra,
sorry.</p>
<p>Note that this issue isn't RubyGems' issue, it's in how ruby is
compiled. If you can reproduce it please report it to <a href="https://bugs.ruby-lang.org">https://bugs.ruby-lang.org</a></p></div>Eric Hodel