Gem Install Errors

Permission Errors

If you receive errors during the install of new Ruby gems then there is a good possibility it has to do with permissions.  To address this you can create a group file, associate your profile to the group profile, and then use the Change Primary Group Profile (CHGPGP) profile to grant authority to /PowerRuby for the group profile.

First create a group profile:

CRTUSRPRF USRPRF(POWRBYGEMS) PASSWORD(*NONE) TEXT('PowerRuby Gem Administration Profile')

Next, assign your profile to that group profile:
CHGUSRPRF USRPRF(my_user_profile) GRPPRF(POWRBYGEMS)

Last, change the "Primary group" of /PowerRuby to be POWRBYGEMS.  Obviously you could narrow this down to just the gems directory, but this will give your profile authority to all the directories should you need it for other purposes.

CHGPGP OBJ('/PowerRuby') NEWPGP(POWRBYGEMS) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)

Here is what the Is command produces at this point:

-bash-4.2$ ls -all /PowerRuby
total 408
drwxrwsr-x    6 qsys    105           8192 Jan 10 18:05
drwxrwsrwx   31 qsys     0            167936 Jan 24 21:18 ..
drwxrwsrwx    8 qsys    105           8192 Jan 10 17:59 oss
drwxrwsrwx    6 qsys    105           8192 Jan 10 18:01 prV1R9
drwxrwsrwx    6 qsys    105           8192 Jan 10 18:03 prV2R0
drwxrwsrwx    6 qsys    105           8192 Jan 10 18:05 prV2R1

SSL Errors

Sometimes while installing a new Gem you can get the following error.

Error:

 # gem bcrypt-ruby ERROR:  Could not find a valid gem 'bcrypt-ruby', here is why:

Unable to download data from https://rubygems.org/ - 
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: 
certificate verify failed (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/bcrypt-ruby..gemspec.rz)                                                              
ERROR:  Possible alternatives: bcrypt-ruby
 

The quickest fix is to alter your Gemfile to have source "http://rubygems.org". Note the absence of 's' in the protocol.