以前までは「rails server」を起動すればlocalhost:3000でアクセスできていたのですが、
Railsチュートリアルの7.5を行ったあとに同じくlocalhost:3000にアクセスしようとしたところ、
「このサイトは安全に接続できません」とエラーが出るようになりました。
URLを見ると「https:localhost:3000」で接続しようとしているようなので、「http:localhost:3000」に書き換えてアクセスしようとしたのですがそれでも同じエラーになりました。
どうすればよいでしょうか?
rails server起動時のコンソールのログは下記になります。
=> Booting Puma
=> Rails 5.1.6 application starting in development
=> Run rails server -h
for more startup options
/Users/username/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/username/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:109: warning: The called method `initialize' is defined here
[2262] Puma starting in cluster mode...
[2262] * Version 3.9.1 (ruby 2.7.0-p0), codename: Private Caller
[2262] * Min threads: 5, max threads: 5
[2262] * Environment: development
[2262] * Process workers: 2
[2262] * Preloading application
[2262] * Listening on tcp://0.0.0.0:3000
[2262] Use Ctrl-C to stop
[2262] - Worker 1 (pid: 2289) booted, phase: 0
[2262] - Worker 0 (pid: 2288) booted, phase: 0
接続時のエラーログは下記になります。
HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
環境は下記になります。
- OS:Mac
- Rails:5.1.7
- puma:3.9.1
- 使用ブラウザ:Google Chrome
どうかよろしくお願いします。
-- 追記
心当たりとして、config/production.rbに
ruby
1config.force_ssl = true
と記述しようとして、間違えて最初にconfig/development.rbに記述してしまいました。
そのことに気付き、development.rbから上記の記述を消したのですが、ダメでした。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/02/16 08:33
2020/02/16 08:49
2020/02/16 12:10
2020/02/17 02:46 編集