You can use RubyMine to edit your Rails credentials file on Mac with the following command:
EDITOR="/Applications/RubyMine.app/Contents/MacOS/rubymine --wait" rails credentials:edit
This will open the file for editing in RubyMine and wait until the file is saved before saving and encrypting the encrypted version of the file.
If you don't have RubyMine or prefer not to use it for editing your credentials file, you can also use the nano editor in Terminal. See how to edit your Rails credentials file using the nano editor here.