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

no implicit conversion of nil into String #2407

Closed
jujugrrr opened this issue Nov 9, 2015 · 2 comments
Closed

no implicit conversion of nil into String #2407

jujugrrr opened this issue Nov 9, 2015 · 2 comments

Comments

@jujugrrr
Copy link
Contributor

jujugrrr commented Nov 9, 2015

Hi,
The latest rubocop version fails to run in our Jenkins environment. It seems to be related to the user name context for the cache folder => 88dc507

Etc.getlogin returns nil, probably because getlogin() nor ENV['USER'] are set http://ruby-doc.org/stdlib-2.2.0/libdoc/etc/rdoc/Etc.html#method-c-getlogin.

It seems Etc.getpwuid.name works even when Etc.getlogin fails.

Error :

no implicit conversion of nil into String
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/result_cache.rb:82:in `join'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/result_cache.rb:82:in `cache_root'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/result_cache.rb:54:in `cleanup'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/runner.rb:66:in `ensure in inspect_files'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/runner.rb:68:in `inspect_files'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/runner.rb:34:in `run'
/var/lib/jenkins/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rubocop-0.35.0/lib/rubocop/cli.rb:26:in `run'
@jonas054
Copy link
Collaborator

jonas054 commented Nov 9, 2015

Same problem as #2406 fixes. Interesting observation about Etc.getpwuid.name.

@edestecd
Copy link

edestecd commented Nov 9, 2015

I have the same issue in gitlab ci, with the Ruby2.1 Docker image. We had to roll back to "0.34.2" to resolve.

schisamo added a commit to chef-boneyard/delivery-truck that referenced this issue Nov 10, 2015
If a builder executes the `rubocop` command with the latest version the
job fails with a `no implicit conversion of nil into String` error. This
is a known issue with this version and has a fix pending:
rubocop/rubocop#2407
rubocop/rubocop#2408

The easiest delivery-truck workaround is to ensure $USER is set in the
subprocess that executes the linting.
bbatsov added a commit that referenced this issue Nov 10, 2015
[Fix #2407] Use Etc.getpwuid.name to retrieve user login
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