当我在Aptana Studio的内置命令行中发出命令$ rails s
时,它会出现此错误,我不知道如何修复该项目可以在https://github.com/nathandunn97/sample_app找到该项目
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load': /home/nathan/Documents/Aptana Studio 3 Workspace/sample
_application/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_sample_application_session'
^
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:588
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `send'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/nathan/Documents/Aptana Studio 3 Workspace/sample_application/config/environment.rb:5
from /home/nathan/Documents/Aptana Studio 3 Workspace/sample_application/config.ru:4:in `require'
from /home/nathan/Documents/Aptana Studio 3 Workspace/sample_application/config.ru:4
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/nathan/Documents/Aptana Studio 3 Workspace/sample_application/config.ru:1:in `new'
from /home/nathan/Documents/Aptana Studio 3 Workspace/sample_application/config.ru:1
答案 0 :(得分:0)
新的ruby哈希语法(key:
)仅适用于ruby 1.9及更高版本。我们可以从您的日志中看到您使用的是1.8版本。