我想從this git repository獲得ribbot開源代碼。我已經下載了rails及其必要的gem,以及mongo db並且已經安裝了「bundle」。 但是,運行該項目時出現以下錯誤。
這怎麼解決?
/Library/Ruby/Gems/1.8/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in`負載':/用戶/ hansarijanto /桌面/影響/ ribbot /配置/initializers/session_store.rb:4:
語法錯誤,意外 ':',期待$結束(SyntaxError錯誤) ... sion_store:cookie_store,鍵: '_ribbot_session',:域名=> ...
我跟蹤了文件,語法錯誤是session_store.rb,它目前看起來像這樣:
# Be sure to restart your server when you modify this file.
# See environment specific overrides also
Ribbot::Application.config.session_store :cookie_store, key: '_ribbot_session', :domain => :all, :expire_after => 10.years
# 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")
# Ribbot::Application.config.session_store :active_record_sto
我試過了,但運行時仍然出現這個錯誤:/Library/Ruby/Gems/1.8/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in'load':/ Users/hansarijanto /Desktop/Impact/ribbot/config/initializers/wrap_parameters.rb:8:語法錯誤,意外 ':',期待DMOZ目錄(SyntaxError錯誤) wrap_parameters格式:[:JSON] – 2012-04-16 16:24:05
@HansAdiputraArijanto這是一個完全不同的文件,但它可能是同一個問題。檢查該文件並查看它是否也使用Ruby 1.9哈希語法,如果是,則以與我答案中相同的方式替換它。 – 2012-04-16 16:25:37
如果我只是將我的紅寶石更新爲1.9,會更有利嗎? – 2012-04-16 16:26:21