Permission Denied Error When Running install_gems.rb

Document ID : KB000102986
Last Modified Date : 21/06/2018
Show Technical Document Details
Issue:
When running install_gems.rb, the following error is shows:
E:/Ruby22-x64/lib/ruby/2.2.0/open3.rb:193:in 'spawn': Permission denied - E:\Ruby22-x64\bin install rubygems-update -v 2.7.6  --no-ri --no-rdoc (Errno::EACCES)
    from E:/Ruby22-x64/lib/ruby/2.2.0/open3.rb:193:in 'popen_run'
    from E:/Ruby22-x64/lib/ruby/2.2.0/open3.rb:93:in 'popen3'
    from E:/Connector/install_gems.rb:73:in 'run_command'
    from E:/Connector/install_gems.rb:39:in 'block (2 levels) in main'
    from E:/Connector/install_gems.rb:37:in 'each'
    from E:/Connector/install_gems.rb:37:in 'block in main'
    from E:/Connector/install_gems.rb:35:in 'chdir'
    from E:/Connector/install_gems.rb:35:in 'main'
    from E:/Connector/install_gems.rb:84:in '<main>'
Cause:
This is caused by having GEM_COMMAND set incorrectly.
Resolution:
GEM_COMMAND should be set to the gem command in the ruby bin directory.

In the example above, ruby is installed in E:\Ruby22-x64.  The gem command is in the bin folder so GEM_COMMAND should be set to E:\Ruby22-x64\bin\gem