Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionParser::InvalidOption ERROR when using --no-rdoc (this is not a warning) #146

Closed
nicocesar opened this issue May 17, 2019 · 2 comments

Comments

@nicocesar
Copy link

https://github.com/maestrodev/puppet-rvm/blob/967c58ce8bbfc3d92dbfe1b29e4a7a5fceee942f/lib/puppet/provider/rvm_gem/gem.rb#L112

--no-rdoc and --no-ri was deprecated in 2011:
rubygems/rubygems@0d22d60

Notice: /Stage[main]/Rvm/Rvm_system_ruby[ruby-2.3.5]/default_use: default_use changed 'false' to 'true'
Could not update: Execution of '/usr/local/rvm/bin/rvm ruby-2.3.5 do gem install -v 0.1.13 --no-rdoc --no-ri jwt' returned 1: ERROR:  While executing gem ... (OptionParser::InvalidOption)

issue #40 proposes a solution with sources, but currently --no-rdoc option will fail to install

@nmagedman
Copy link

As @nicocesar said, gem install --no-rdoc has been deprecated for ages.
gem 3.0 (distributed with ruby 2.6) finally dropped support for it, causing deploys to hard fail.

I attempted to PR a fix in #147, however this repo seems to have been abandoned. The last commit was in 2017. The Travis-CI setup is so outdated that all builds fail. (I submitted an empty PR, #148, to confirm that even master fails.)

WORKAROUND
As a total Kludge, we can make things work for now by specifying a source option to rvm_gem, e.g.:

  rvm_gem { 'erubis':
    ruby_version => "ruby-${ruby_version}",
    require      => Rvm_system_ruby[$ruby_version],
    source       => "https://rubygems.org/",
  }

By total happenstance, if you specify a rubygems source option to rvm_gem, it bypasses the codepath that adds the --no-rdoc command-line option to gem install.
See lib/puppet/provider/rvm_gem/gem.rb:

 91     if source = resource[:source]
          …
109         command << "--source" << "#{source}" << resource[:name]
          …
111     else
112       command << "--no-rdoc" << "--no-ri" <<  resource[:name]
113     end

hugocorbucci added a commit to agile-alliance-brazil/event_registrations that referenced this issue Feb 10, 2020
@ekohl
Copy link
Member

ekohl commented Jul 6, 2022

Addressed in 4382114

@ekohl ekohl closed this as completed Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants