LoginSignup
2
2

More than 5 years have passed since last update.

ruby on railsでpuma.rbが見つからない時

Posted at

はじめに

RoRのチュートリアルでherokuのローカルウェブが起動出来ずに困ったのでメモ。

$ heroku local web
[WARN] No ENV file found
1:19:26 PM web.1 |  bundler: failed to load command: puma 
1:19:26 PM web.1 |  Errno::ENOENT: No such file or directory @ rb_sysopen - config/puma.rb

heroku

herokuのページにサンプルがあった。

workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

これをconfig/puma.rbとして保存すれば起動出来ます。

2
2
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
2
2