2016-01-31 92 views
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] 

我試過了一切。我重新安裝了rbenv,ruby等。根據下面的帖子,許多人都有同樣的問題,但它不適合我。Rails:已經初始化常量APP_PATH

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

一個奇怪的是,這個錯誤只發生在特定的應用程序。在新創建的應用程序中,rails s效果很好。我很感謝這個問題的任何幫助。

+0

你嘗試禁用春天嗎? – Vasfed

回答

0

嘗試投入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'