gem install
fails with the following error, How do I specify the heap size configuration in a common place so that I don't have to re-define this every time.
Error: Your application used more memory than the safety cap of 500m.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace.
This error and message are actually coming from jruby, not gem. Fortunately, jruby checks for default options in the JRUBY_OPTS environment variable.
So, try
export JRUBY_OPTS=-J-Xmx1024m
, and then, whenever you callgem install
, jruby should automatically run with a 1024MB memory cap.