Develop on windows, run unicorn in production on heroku

后端 未结 2 367
抹茶落季
抹茶落季 2020-12-24 14:42

I have a new Rails project and i decided to give heroku a try, deployment seems very easy there

I am developing on windows, so running unicorn is not a choice, but w

相关标签:
2条回答
  • 2020-12-24 14:52

    The alternative solution (which the original poster was very close to) is

    group :production do
      gem 'unicorn'
    end
    

    and then using

    bundle install --without production
    

    on your Windows machine.

    Heroku sidenote (not tested)

    Unlike the accepted answer, this should not cause Heroku to ignore your Gemfile.lock

    This is because Heroku checks your Gemfile for mswin and mingw when deciding if it is Windows generated or not.

    0 讨论(0)
  • 2020-12-24 15:09

    You can target specific platforms in your Gemfile:

    platforms :ruby do # linux
      gem 'unicorn'
    end
    
    platforms :mswin do
      # gems specific to windows
    end
    

    see the manpages for gemfile for more information.

    0 讨论(0)
提交回复
热议问题