1

我想从这个 git 存储库中获取 ribbot 一个开源代码。我已经下载了 rails 及其必要的 gem,以及 mongo db 并安装了“捆绑包”。但是在运行项目时出现以下错误。

如何解决?

/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/session_store.rb :4:

语法错误,意外 ':',期待 $end (SyntaxError) ...sion_store :cookie_store, key: '_ribbot_session', :domain =>...

我已经使用语法错误跟踪文件 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
4

2 回答 2

3

您正在使用 Ruby 1.8,config/initializers/session_store.rb. 以下片段:

key: '_ribbot_session'

应该

:key => '_ribbot_session'
于 2012-04-16T16:20:43.100 回答
2

由于 ribbot 使用的是 ruby​​ 1.9,您应该更新您的 ruby​​ 版本,而不是更改代码以使其工作,当前的 ruby​​ 版本是 1.9.3 http://www.ruby-lang.org/en/downloads/

安装说明

  • 如果您使用的是 mac 操作系统:

http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac

  • 如果您使用的是 ubuntu linux:

http://www.rubyinside.com/how-to-install-ruby-1-9-2-and-rails-3-0-on-ubuntu-10-10-4148.html

于 2012-04-16T16:26:38.477 回答