tehmaspc / puppet-magnum

https://rubygems.org/gems/puppet-magnum
Other
30 stars 13 forks source link

Can't install on MacOS: undefined method `[]' for nil:NilClass #54

Closed willsheppard closed 1 year ago

willsheppard commented 5 years ago
uname -a
Darwin Wills-MBP 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
$ brew install ruby
==> Installing dependencies for ruby: libyaml
==> Installing ruby dependency: libyaml
==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.2.2.high_sierra.bottle.t
######################################################################## 100.0%
==> Pouring libyaml-0.2.2.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libyaml/0.2.2: 9 files, 299.3KB
==> Installing ruby
==> Downloading https://homebrew.bintray.com/bottles/ruby-2.6.3.high_sierra.bottle.tar.
==> Downloading from https://akamai.bintray.com/52/52face1cf238072f1964cb6ace6245100088
######################################################################## 100.0%
==> Pouring ruby-2.6.3.high_sierra.bottle.tar.gz
==> Caveats
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/2.6.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

For compilers to find ruby you may need to set:
  export LDFLAGS="-L/usr/local/opt/ruby/lib"
  export CPPFLAGS="-I/usr/local/opt/ruby/include"

For pkg-config to find ruby you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/ruby/2.6.3: 19,372 files, 32.4MB
==> Caveats
==> ruby
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/2.6.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

For compilers to find ruby you may need to set:
  export LDFLAGS="-L/usr/local/opt/ruby/lib"
  export CPPFLAGS="-I/usr/local/opt/ruby/include"

For pkg-config to find ruby you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"
$ which ruby
/usr/bin/ruby

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ which ruby
/usr/local/opt/ruby/bin/ruby
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin17]
$ which gem
/usr/local/opt/ruby/bin/gem
$ gem install puppet-magnum
Fetching bundler-2.0.2.gem
Fetching version-1.1.1.gem
Fetching CFPropertyList-2.2.8.gem
Fetching text-1.3.1.gem
Fetching fast_gettext-1.1.2.gem
Fetching thor-0.20.3.gem
Fetching locale-2.1.2.gem
Fetching gettext-3.2.9.gem
Fetching gettext-setup-0.30.gem
Fetching json_pure-1.8.6.gem
Fetching hiera-3.5.0.gem
Fetching facter-2.5.5-universal-darwin.gem
Fetching puppet-4.10.12-universal-darwin.gem
Fetching diff-lcs-1.3.gem
Fetching rspec-support-3.7.1.gem
Fetching rspec-mocks-3.7.0.gem
Fetching rspec-expectations-3.7.0.gem
Fetching rspec-core-3.7.1.gem
Fetching rspec-3.7.0.gem
Fetching puppet-lint-2.3.6.gem
Fetching rspec-puppet-2.6.15.gem
Fetching puppet-syntax-2.5.0.gem
Fetching metaclass-0.0.4.gem
Fetching mocha-1.9.0.gem
Fetching puppetlabs_spec_helper-2.6.2.gem
Fetching deep_merge-1.2.1.gem
Fetching stringify-hash-0.0.2.gem
Fetching beaker-hostgenerator-1.1.35.gem
Fetching puppet-magnum-4.1.1.gem
bundler's executable "bundle" conflicts with /usr/local/lib/ruby/gems/2.6.0/bin/bundle
Overwrite the executable? [yN]  y
bundler's executable "bundler" conflicts with /usr/local/lib/ruby/gems/2.6.0/bin/bundler
Overwrite the executable? [yN]  y
Successfully installed bundler-2.0.2
Successfully installed thor-0.20.3
Successfully installed version-1.1.1
Successfully installed CFPropertyList-2.2.8
Successfully installed locale-2.1.2
Successfully installed text-1.3.1
Successfully installed gettext-3.2.9
Successfully installed fast_gettext-1.1.2
Successfully installed gettext-setup-0.30
Successfully installed json_pure-1.8.6
Successfully installed hiera-3.5.0
Successfully installed facter-2.5.5-universal-darwin
Successfully installed puppet-4.10.12-universal-darwin
Successfully installed diff-lcs-1.3
Successfully installed rspec-support-3.7.1
Successfully installed rspec-mocks-3.7.0
Successfully installed rspec-expectations-3.7.0
Successfully installed rspec-core-3.7.1
Successfully installed rspec-3.7.0
Successfully installed puppet-lint-2.3.6
Successfully installed rspec-puppet-2.6.15
Successfully installed puppet-syntax-2.5.0
Successfully installed metaclass-0.0.4
Successfully installed mocha-1.9.0
Successfully installed puppetlabs_spec_helper-2.6.2
Successfully installed deep_merge-1.2.1
Successfully installed stringify-hash-0.0.2
Successfully installed beaker-hostgenerator-1.1.35
Successfully installed puppet-magnum-4.1.1
Parsing documentation for bundler-2.0.2
Installing ri documentation for bundler-2.0.2
Parsing documentation for thor-0.20.3
Installing ri documentation for thor-0.20.3
Parsing documentation for version-1.1.1
Installing ri documentation for version-1.1.1
Parsing documentation for CFPropertyList-2.2.8
Installing ri documentation for CFPropertyList-2.2.8
Parsing documentation for locale-2.1.2
Installing ri documentation for locale-2.1.2
Parsing documentation for text-1.3.1
Installing ri documentation for text-1.3.1
Parsing documentation for gettext-3.2.9
Installing ri documentation for gettext-3.2.9
Parsing documentation for fast_gettext-1.1.2
Installing ri documentation for fast_gettext-1.1.2
Parsing documentation for gettext-setup-0.30
Installing ri documentation for gettext-setup-0.30
Parsing documentation for json_pure-1.8.6
Installing ri documentation for json_pure-1.8.6
Parsing documentation for hiera-3.5.0
Installing ri documentation for hiera-3.5.0
Parsing documentation for facter-2.5.5-universal-darwin
Installing ri documentation for facter-2.5.5-universal-darwin
Parsing documentation for puppet-4.10.12-universal-darwin
Before reporting this, could you check that the file you're documenting
has proper syntax:

  /usr/local/opt/ruby/bin/ruby -c lib/puppet/vendor/rgen/lib/rgen/instantiator/json_parser.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

    (NoMethodError) undefined method `[]' for nil:NilClass

ERROR:  While executing gem ... (NoMethodError)
    undefined method `[]' for nil:NilClass
tehmaspc commented 5 years ago

This looks like RDoc cannot generate docs for the puppet gem to me.

Are you even able to run puppet-magnum regardless?

For kicks - do you mind trying if the install works if you tell gem to ignore installing gem docs?

You can do that by throwing the following into your ~/.gemrc file:

❯ cat ~/.gemrc
gem: --no-document

BTW - I just installed Ruby 2.6.3 via rbenv on my Mac and was able to install puppet-magnum cleanly - albeit - I don't install docs ever :)

Let me know if any of the above work for you - and I can try to dig deeper.

Cheers, Tehmasp