Sunday, May 24, 2015

Openshift, Plackware and Dancer2 with Free account

 
 rhc app delete tmgt --confirm
 rhc app create tmgt -t https://raw.github.com/debug-ito/openshift-cartridge-plack/release_0.1.0/metadata/manifest.yml
Login on rhc and install the require perl modules like this:
export PERL_CPANM_OPT="-L $HOME/plack/local"
cpanm install Dancer2
cpanm install DBD::SQLite
cpanm install Starman --force
cpanm install Moose --force
cpanm install PDF::Reuse --force
cpanm install Date::Formatter --force
cpanm install Image::Info --force
cpanm String::CRC32 Math::Round Math::Polygon
cpanm Log::Log4perl Cache::FileCache

Repeat this command and the above statement to get your dependencies sorted out ...
 perl app.psgi
Next I had to add variables to find the config file... *plack_config.pl*
## This script is executed to set environment variables for control
## actions such as starting and stopping your app.

## See https://metacpan.org/pod/plackup for detail.

$ENV{PLACK_ENV} = "development";

## If you prefer Starman, for example, uncomment the following line
## and put "requires 'Starman';" into cpanfile.

$ENV{PLACK_SERVER} = "Starman";

$ENV{DANCER_CONFDIR} = $ENV{OPENSHIFT_REPO_DIR};

$ENV{PERL5LIB} = $ENV{OPENSHIFT_REPO_DIR} . "/lib:"  . $ENV{PERL5LIB} ;