내 레일 앱의 환경을 실제로 설정하려고 시도했을 때 다 피곤했다고 생각합니다. environment.rb에에서 htaccess로RAILS_ENV가 설정되었지만 Rails.env가 달라졌습니다
RailsEnv production (produces a 500 server error)
에서
ENV['RAILS_ENV'] ||= 'production' #does not set RAILS_ENV
ENV['RAILS_ENV'] = 'production' #sets RAILS_ENV to 'production', but Rails.env stays at 'development'
내가 Bluehost를 사용하고 있습니다 ...하지만 모든 어제까지 잘 일하고있다 ... 나는 생각하지 않는다 내가 변경 한 ...
편집 : 죄송합니다, 그것은 또한
v2를 레일 있다는 얘기를 깜빡 했네요, environment.rb에서 RAILS_ENV 변수를 설정 한 위치에 따라 오류가 발생합니다. 내가 부팅 후에 넣어 경우
[Tue Jul 26 11:42:20 2011] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Tue Jul 26 11:42:20 2011] [error] [client x.x.x.x] Premature end of script headers: dispatch.fcgi
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
ENV['RAILS_ENV'] = "production" unless (File.expand_path(File.dirname(__FILE__)) =~ /MyProductionFolder/).nil?
require File.join(File.dirname(__FILE__), 'boot')
ENV['GEM_PATH'] = '/home/usr/ruby/gems'
가입, 변수가 설정됩니다하지만 실제 환경 아무튼 : 나는 그것을해야하는데에게있어 장소에 보관하는 경우, 나는 오류 변화는 없어.
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
ENV['RAILS_ENV'] = "production" unless (File.expand_path(File.dirname(__FILE__)) =~ /MyProductionFolder/).nil?
ENV['GEM_PATH'] = '/home/usr/ruby/gems'
수정 # 3 :의 검사 ENV [ 'RAILS_ENV'는, 내가 "생산"을 볼 수 있지만 직접 RAILS_ENV를 검사 할 때, 나는 "개발"을 참조하십시오.
호스트가 변경되었거나 업그레이드 된 레일 또는 다른 것일 수 있습니다. – rubish
어쩌면 예상대로 그들은 내게 변명을하고 "레일 포럼을 확인"할 것을 말하고 있습니다 – JakeTheSnake
environment.rb 파일에서'Rails.env = 'production'' 설정을 시도 했습니까? –