2016-07-02 10 views
0

OpenShift에 Rails 앱을 설치하고 기본 코드를 가져 왔습니다. 실행을 시도 할 때 다음 오류가 발생했습니다.레일즈 서버를 시작하는 중 오류가 발생했습니다 : "unexpected .."

C:/Development/Ruby/lib/ruby/gems/2.3.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load': C:/HEATH3N/FirstApp/config/initializers/session_store.rb:1: syntax error, unexpected .. (SyntaxError) 
../../.openshift/lib/session_store.rb 

문제가 무엇인지 명확하지 않습니다. 나는 문제가있는 파일을 보았고 아무 잘못도 보지 않았다. 나는 Stack Overflow에서 파일에 대한 또 다른 문제를 묻는 질문을 발견했다. (새로운 해시 스타일은 구형 Ruby 버전에서는 지원되지 않는다.) Ruby 2.3 (Rails 4.1.4)을 사용하고 있으며 내 오류가 다르다.

require File.join(Rails.root,'lib','openshift_secret_generator.rb') 

# Be sure to restart your server when you modify this file. 

# Set token based on intialize_secret function (defined in initializers/secret_generator.rb) 

Rails.application.config.session_store :cookie_store, :key => initialize_secret(
    :session_store, 
    '_railsapp_session' 
) 

# Use the database for sessions instead of the cookie-based default, 
# which shouldn't be used to store highly confidential information 
# (create the session table with "rails generate session_migration") 
# RailsApp::Application.config.session_store :active_record_store 
+0

파일을 게시 할 수 있습니까? –

+0

아, 죄송합니다 ... 질문을 업데이트했습니다. – HEATH3N

+0

레일 콘솔을 열고'RUBY_VERSION'을 입력하면 어떻게됩니까? –

답변

0

과 같이 뭔가를 시도 -

require File.expand_path(‘../lib/openshift_secret_generator.rb‘, __FILE__) 

또는

require Rails.root.join('lib', 'openshift_secret_generator.rb').to_s 

이 업데이 트를 제발 당신을 위해 하나 또는 둘 모두 일 경우.

+0

불행히도 어떤 차이도 없었습니다. – HEATH3N

+0

Doh! 미안합니다. 오류가 변경 되었습니까? –

+0

또한 변경 사항을 확인한 후 서버를 다시 시작 했습니까? –

관련 문제