LoginSignup
8
9

More than 5 years have passed since last update.

Ruby2.0.0 + Rails3.2.12 + Puma + Heroku

Posted at


  • vi Gemfile
gem 'puma'
bundle install
rails s puma
  • vi Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
  • vi config/environments/production.rb
  # For Puma
  config.threadsafe!
  • vi config/puma.rb
require "active_record"
cwd = File.dirname(__FILE__)+"/.."
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
ActiveRecord::Base.establish_connection(ENV["DATABASE_URL"] || YAML.load_file("#{cwd}/config/database.yml")[ENV["RACK_ENV"]])
ActiveRecord::Base.verify_active_connections!
  • NewRelic
heroku config:add NEWRELIC_DISPATCHER=Puma
8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9