Skip to content

Commit

Permalink
Hotfix: Detect running rails server and explain proper steps
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed May 21, 2024
1 parent b0639e3 commit 09a9e5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: env RUBY_DEBUG_OPEN=true bin/rails server -p ${PORT:-3000}
web: env RUBY_DEBUG_OPEN=true USING_PROCFILE=true bin/rails server -p ${PORT:-3000}
worker: bin/rake solid_queue:start
tailwind: bin/rails tailwindcss:watch
tailwind: bin/rails tailwindcss:watch
15 changes: 15 additions & 0 deletions config/initializers/warn_on_rails_server.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if defined?(Rails::Server)
if ENV['RAILS_ENV'] == 'development' && ENV['USING_PROCFILE'] != 'true'
puts ""
puts "###"
puts "### WARNING: You are running 'rails server' outside of the Procfile. This misses the SolidQueue and Tailwind."
puts "###"
puts "### Cancel this with Ctrl + c and instead run 'bin/dev'"
puts "###"
puts "### Full setup instructions are here: https://github.com/allyourbot/hostedgpt#contribute-as-a-developer"
puts "### (Or, press Enter to proceed anyway)"
puts "###"
gets
end
end

0 comments on commit 09a9e5c

Please sign in to comment.