1
$ rails server
bin/rails:6: warning: already initialized constant APP_PATH
/Users/songhowon/job/onboardiq_app/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

I tried everything. I reinstalled rbenv, ruby, etc. Many peole had the same issue according to the following post, but it doesn't work for me.

rails server bin/rails:6: warning: already initialized constant APP_PATH error

A strange thing is this error only occurs in a specific app. In a newly created app, rails s works great. I'd appreciate any help for this problem.

Community
  • 1
  • 1
Maximus S
  • 10,759
  • 19
  • 75
  • 154

1 Answers1

0

Try putting into bin/rails:

#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
  # need to investigate this error
  # but in production it will happen, so cannot just raise everytime
  raise if defined?(Rails) and Rails.env.development?
end
APP_PATH = File.expand_path('../../config/application',  __FILE__)
require_relative '../config/boot'
require 'rails/commands'
Vasfed
  • 18,013
  • 10
  • 47
  • 53