Puma - show full logs when run server with config file

前端 未结 4 2059
故里飘歌
故里飘歌 2021-02-19 03:09

I installed puma gem and when I start rails server by rails s I can see full output:

$ rails s 
/Users/serj/.rvm/gems/ruby-2.2.1@email_         


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-19 03:48

    If you use foreman or a Procfile, you can add the tail -f log to your Procfile. This is what I use:

    # Procfile.dev
    web: bundle exec puma -p $PORT
    webpack: bin/webpack-dev-server
    log: tail -f log/development.log
    

    I then start rails like this:

    $> PORT=3000 foreman start -f Procfile.dev
    

    I actually have an alias for this in my .zshrc:

    alias railss='PORT=3000 foreman start -f Procfile.dev'
    

    So I can simply start Rails with:

    $> railss
    

提交回复
热议问题