开发者

How to create a Heroku rails dev environment in actual development mode?

开发者 https://www.devze.com 2023-04-13 00:56 出处:网络
I\'m attempting to mimic, as close as possible, the Heroku deployment environment but in actual development mode for a Rails app.In other words, I\'d like more verbose output from t开发者_开发百科he t

I'm attempting to mimic, as close as possible, the Heroku deployment environment but in actual development mode for a Rails app. In other words, I'd like more verbose output from t开发者_开发百科he thin console logs web and worker processes and I'd like for the assets pipeline to be refreshed appropriately vs having to run a command to refresh them.

The reason I have to do this is due to some testing of additional workers that need to function during development and testing phases.

Currently I have foreman running a procfile locally which spawns thin. Here are the commands that it steps through:

First I start it via Foreman with RACK_ENV=development PORT=3000 foreman start --port $PORT

Second, in my Procfile I have:

`web:    bundle exec thin start -p $PORT -e $RACK_ENV`
`worker: bundle exec ruby worker.rb`

These execute just fine, however I have two seeming problems that I'd like to overcome:

A) I have to run bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile so it seems as though thin does not honor a development mode that does not require asset precompilation. I tried to add config.assets.compile = true into my config/environments/development.rb, but that did not seemingly help the situation. The real problem seems to be that actual images in the assets folder are not refreshed without this manual preocompile step.

B) I am not seeing any more verbose development level logging in the output console. I would like to see a verbose request log as well as the debug print statements that I have in my worker script. None of these propagate back up to the console log where the foreman command is initially run.

The thought has come to mind that perhaps I should just have a Procfile.development and in there have webrick instead of thin, however that only resolves point A and leaves the question of point B above.

Thus my question, how can I accomplish my original designs using foreman + thin?


I ended up approaching this at a little different slant and got through the issue. The core problem I was having was the the logging facility was being overridden by one of gem's we've been using and therefore had to force logging to use the Rails logger with more verbosity:

How to increase Heroku log drain verbosity to include all Rails app details?

0

精彩评论

暂无评论...
验证码 换一张
取 消