portruby-on-rails-4webrick

How to change default port of a Rails 4 app?


I know that I can start a rails server on another port via -p option. But I'd like to setup another port per application as long as I start webrick.

Any ideas?

Regards Felix


Solution

  • Quick solution: Append to Rakefile

    task :server do
      `bundle exec rails s -p 8080`
    end
    

    Then run rake server