This command attempts to create a file at $HOME/.rnd and you see the error because the file cannot be created.
You must tell openssl which file to use for writing random state and you do so by exporting the $RANDFILE environment variable. On Openshift you can write in $HOME_DIR directory so create the command as follows:
export RANDFILE=$HOME_DIR/.rnd
openssl genrsa -des3 -out $OPENSHIFT_DATA_DIR/myApp.key 2048