production.yml & development.yml
Hi, There are 2 environment config file in the dancer web framework. Where to set which environment file( development.ml or production.yml) is used? Many thanks, Wendy
Hi! 2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says: "you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production" Or with plackup: plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml". -- Wbr Kõike hääd, Gunnar
Thanks for the reply! I found the config file in /data/dancer/ I changed the following line '-E development' to '-E production' Now it looks like: STARMAN_OPTS="--workers 4 -E production --preload_app" And the development.yml is exactly the same as production.yml But it becomes not working when switching to production. Any ideas what is missing? Are there anywhere else need to change to production as well? Many thanks, Wendy On 7/4/16, 3:50 PM, "dancer-users on behalf of WK" <dancer-users-bounces@dancer.pm on behalf of wanradt@gmail.com> wrote:
Hi!
2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says:
"you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production"
Or with plackup:
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl
And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml".
-- Wbr Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 07/04/2016 05:33 PM, Wanjuan Yang wrote:
Thanks for the reply!
I found the config file in /data/dancer/
I changed the following line '-E development' to '-E production'
Now it looks like:
STARMAN_OPTS="--workers 4 -E production --preload_app"
And the development.yml is exactly the same as production.yml
But it becomes not working when switching to production.
Any ideas what is missing? Are there anywhere else need to change to production as well?
Many thanks, Wendy
How do you know it is not working when both environment files are the same? Regards Racke
On 7/4/16, 3:50 PM, "dancer-users on behalf of WK" <dancer-users-bounces@dancer.pm on behalf of wanradt@gmail.com> wrote:
Hi!
2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says:
"you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production"
Or with plackup:
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl
And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml".
-- Wbr Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
Hi Race, The website is not running when I switch to production.yml With the same content in yml file, but using development.yml. It is working alright. Any ideas? Thanks, Wendy On 7/4/16, 4:35 PM, "dancer-users on behalf of Stefan Hornburg (Racke)" <dancer-users-bounces@dancer.pm on behalf of racke@linuxia.de> wrote:
On 07/04/2016 05:33 PM, Wanjuan Yang wrote:
Thanks for the reply!
I found the config file in /data/dancer/
I changed the following line '-E development' to '-E production'
Now it looks like:
STARMAN_OPTS="--workers 4 -E production --preload_app"
And the development.yml is exactly the same as production.yml
But it becomes not working when switching to production.
Any ideas what is missing? Are there anywhere else need to change to production as well?
Many thanks, Wendy
How do you know it is not working when both environment files are the same?
Regards Racke
On 7/4/16, 3:50 PM, "dancer-users on behalf of WK" <dancer-users-bounces@dancer.pm on behalf of wanradt@gmail.com> wrote:
Hi!
2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says:
"you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production"
Or with plackup:
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl
And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml".
-- Wbr Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 07/04/2016 05:40 PM, Wanjuan Yang wrote:
Hi Race,
The website is not running when I switch to production.yml With the same content in yml file, but using development.yml. It is working alright.
Any ideas?
Thanks, Wendy
Hello Wendy, do you see any errors from the output of your startup command? Any error messages in the log file? Regards Racke
On 7/4/16, 4:35 PM, "dancer-users on behalf of Stefan Hornburg (Racke)" <dancer-users-bounces@dancer.pm on behalf of racke@linuxia.de> wrote:
On 07/04/2016 05:33 PM, Wanjuan Yang wrote:
Thanks for the reply!
I found the config file in /data/dancer/
I changed the following line '-E development' to '-E production'
Now it looks like:
STARMAN_OPTS="--workers 4 -E production --preload_app"
And the development.yml is exactly the same as production.yml
But it becomes not working when switching to production.
Any ideas what is missing? Are there anywhere else need to change to production as well?
Many thanks, Wendy
How do you know it is not working when both environment files are the same?
Regards Racke
On 7/4/16, 3:50 PM, "dancer-users on behalf of WK" <dancer-users-bounces@dancer.pm on behalf of wanradt@gmail.com> wrote:
Hi!
2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says:
"you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production"
Or with plackup:
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl
And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml".
-- Wbr Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
Hi Racke, Yes. request to GET /translation/drug_list crashed: Can't call method "fetchrow_array" on an undefined value at /data/www/live/Gdsc/lib/Dancer/Plugin/Utils.pm line 182. in /data/perl5/lib/perl5/Dancer/Handler.pm l. 98 It looks like the database do differently when the environment changes. Wendy On 7/4/16, 4:44 PM, "dancer-users on behalf of Stefan Hornburg (Racke)" <dancer-users-bounces@dancer.pm on behalf of racke@linuxia.de> wrote:
On 07/04/2016 05:40 PM, Wanjuan Yang wrote:
Hi Race,
The website is not running when I switch to production.yml With the same content in yml file, but using development.yml. It is working alright.
Any ideas?
Thanks, Wendy
Hello Wendy,
do you see any errors from the output of your startup command?
Any error messages in the log file?
Regards Racke
On 7/4/16, 4:35 PM, "dancer-users on behalf of Stefan Hornburg (Racke)" <dancer-users-bounces@dancer.pm on behalf of racke@linuxia.de> wrote:
On 07/04/2016 05:33 PM, Wanjuan Yang wrote:
Thanks for the reply!
I found the config file in /data/dancer/
I changed the following line '-E development' to '-E production'
Now it looks like:
STARMAN_OPTS="--workers 4 -E production --preload_app"
And the development.yml is exactly the same as production.yml
But it becomes not working when switching to production.
Any ideas what is missing? Are there anywhere else need to change to production as well?
Many thanks, Wendy
How do you know it is not working when both environment files are the same?
Regards Racke
On 7/4/16, 3:50 PM, "dancer-users on behalf of WK" <dancer-users-bounces@dancer.pm on behalf of wanradt@gmail.com> wrote:
Hi!
2016-07-04 17:39 GMT+03:00 Wanjuan Yang <wy1@sanger.ac.uk>:
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
It depends, how you deploy your app, but if you run wit default development server, http://search.cpan.org/dist/Dancer/lib/Dancer/Introduction.pod says:
"you can change the running environment using the --environment command line switch"
From http://search.cpan.org/dist/Dancer/lib/Dancer/Deployment.pod :
Another way is to set env variable: DANCER_ENVIRONMENT "production"
Or with plackup:
plackup -E deployment -s Starman --workers=10 -p 5001 -a bin/app.pl
And while running with uwsgi, it assumes your environment is "uwsgi", so you should have config file "uwsgi.yml".
-- Wbr Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 07/04/2016 05:53 PM, Wanjuan Yang wrote:
Hi Racke,
Yes.
request to GET /translation/drug_list crashed: Can't call method "fetchrow_array" on an undefined value at /data/www/live/Gdsc/lib/Dancer/Plugin/Utils.pm line 182. in /data/perl5/lib/perl5/Dancer/Handler.pm l. 98
It looks like the database do differently when the environment changes.
Wendy
Hello Wendy, yes indeed. Looks like you need to debug why this happens. Regards Racke -- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
Thanks a lot! I found the bug! It is indeed in the actual codes rather than in the config file which I initially thought. Wendy On 7/4/16, 4:58 PM, "dancer-users on behalf of Stefan Hornburg (Racke)" <dancer-users-bounces@dancer.pm on behalf of racke@linuxia.de> wrote:
On 07/04/2016 05:53 PM, Wanjuan Yang wrote:
Hi Racke,
Yes.
request to GET /translation/drug_list crashed: Can't call method "fetchrow_array" on an undefined value at /data/www/live/Gdsc/lib/Dancer/Plugin/Utils.pm line 182. in /data/perl5/lib/perl5/Dancer/Handler.pm l. 98
It looks like the database do differently when the environment changes.
Wendy
Hello Wendy,
yes indeed. Looks like you need to debug why this happens.
Regards Racke
-- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 07/04/2016 04:39 PM, Wanjuan Yang wrote:
Hi,
There are 2 environment config file in the dancer web framework.
Where to set which environment file( development.ml or production.yml) is used?
Many thanks, Wendy
Hello Wendy, by default Dancer uses the development environment. If you want a different environment, add an option to the plackup command: plackup -E production Also, you can set the environment variable DANCER_ENVIRONMENT in your shell: export DANCER_ENVIRONMENT=production Regards Racke -- Please visit our 3rd Perl Dancer Conference 2016 in Vienna: https://www.perl.dance/.
participants (3)
-
Stefan Hornburg (Racke) -
Wanjuan Yang -
WK