ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Fix clash with dotenv gem that prevents applications from starting. #96

Closed creature closed 9 years ago

creature commented 9 years ago

Dotenv is a gem that helps Rails applications keep their configuration in environment variables, and loads them automatically upon application startup. This configuration is stored in a file called .env. Prax also tries to load environment variables from .env upon startup.

If your environment variables are both in a Bash-friendly format, this doesn't matter. But Dotenv allows users to use YAML to store their config; Bash can't source this, which causes the app to fail to start without outputting anything into the log.

This pull request checks for the existence of Dotenv in your bundle. If it finds it, then Prax will not load your .env file. Instead, it leaves that up to Dotenv.

This should fix https://github.com/ysbaddaden/prax/issues/95.

ysbaddaden commented 9 years ago

I'm not confortable with hacks that actually avoid a bug for a specific gem. It also assumes that bundler is installed, thought it may not (I'm using Prax with pure JS projects, with port forwarding to vagrant boxes, etc).

An actual solution would be to either: