Install error: "no implicit conversion of nil into String"
Overview
When trying to gem install aws-sdk on El Cap, I get no implicit conversion of nil into String (details below).
System Information
- Mac OS X 10.11.6 (15G1510)
- System ruby (ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15])
gem install output
$ sudo gem install aws-sdk -V --version '~> 2'
... Snip wget stuff ...
Installing gem aws-sdk-core-2.9.42
... Snip file list ...
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
@mbaxa That looks weird to me, try to reproduce with that ruby version on my mac right now ...
@mbaxa I couldn't reproduce the error with exactly same ruby version. Could you share more error traces by --backtrace option? That might helps identifying the cause?
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:171:in `check_executable_overwrite'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:384:in `block in generate_bin'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:371:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:371:in `generate_bin'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:231:in `install'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:379:in `block in install'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `each_with_index'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `install'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:166:in `block in execute'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:158:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/commands/install_command.rb:158:in `execute'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command_manager.rb:170:in `process_args'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/command_manager.rb:130:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:60:in `run'
/usr/bin/gem:21:in `<main>'
This appears to be an issue with your RubyGems setup, rather than the aws-sdk gem. Likely related issue.
I'd recommend you upgrade your version of RubyGems and see if that fixes the issue for you.
Did sudo gem update --system, it worked fine, now I get the following different error when running sudo gem install -V --backtrace aws-sdk
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/aws.rb
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:504:in `initialize'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:504:in `open'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:504:in `generate_bin_script'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:484:in `block in generate_bin'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:468:in `each'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:468:in `generate_bin'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:308:in `install'
/Library/Ruby/Site/2.0.0/rubygems/resolver/specification.rb:97:in `install'
/Library/Ruby/Site/2.0.0/rubygems/request_set.rb:166:in `block in install'
/Library/Ruby/Site/2.0.0/rubygems/request_set.rb:156:in `each'
/Library/Ruby/Site/2.0.0/rubygems/request_set.rb:156:in `install'
/Library/Ruby/Site/2.0.0/rubygems/commands/install_command.rb:205:in `install_gem'
/Library/Ruby/Site/2.0.0/rubygems/commands/install_command.rb:255:in `block in install_gems'
/Library/Ruby/Site/2.0.0/rubygems/commands/install_command.rb:251:in `each'
/Library/Ruby/Site/2.0.0/rubygems/commands/install_command.rb:251:in `install_gems'
/Library/Ruby/Site/2.0.0/rubygems/commands/install_command.rb:158:in `execute'
/Library/Ruby/Site/2.0.0/rubygems/command.rb:310:in `invoke_with_build_args'
/Library/Ruby/Site/2.0.0/rubygems/command_manager.rb:169:in `process_args'
/Library/Ruby/Site/2.0.0/rubygems/command_manager.rb:139:in `run'
/Library/Ruby/Site/2.0.0/rubygems/gem_runner.rb:55:in `run'
/usr/bin/gem:21:in `<main>'
I've verified that there is no /usr/bin/aws.rb, /usr/bin is owned by root:wheel, and the gem install was run as root, so not sure why it couldn't write the file (if that is the problem)
I think this may have to do with the general recommendation not to use sudo with RubyGems, but I'm not sure what is specific to your environment.
I've found a Stack Overflow question which seems to address your exact issue. I'd look through those answers and see which options work best for you.
Closing as I think we've found the exact cause of both issues, feel free to reopen if you go through troubleshooting and see something SDK-specific.
Yeah, looks like system ruby is just a no go for OS X, too many problems getting it to work.
This error comes when the name of the project contains the word "Nil". when i removed it, this error is not there. Not sure why its not interpreted as NIl