I have both ruby 1.8.7 and 1.9.2 installed on my system. I have a rails project that I initially built with ruby 1.9.2; but because I heare 1.8.7 is faster, I am trying to switch and finish it using ruby 1.8.7. However, whenever I run certain commands, right now its Rails g, I get the following output in my terminal:
C:\Users\Edu\workspace\tasks>rails g
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_support/depende
ncies.rb:234:in `load': C:/Users/Edu/workspace/tasks/config/initializers/session
_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_tasks_session'
^
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_su
pport/dependencies.rb:234:in `load'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_su
pport/dependencies.rb:223:in `load_dependency'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_su
pport/dependencies.rb:640:in `new_constants_in'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_su
pport/dependencies.rb:223:in `load_dependency'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_su
pport/dependencies.rb:234:in `load'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/engine.r
b:556
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/engine.r
b:555:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/engine.r
b:555
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/initiali
zable.rb:30:in `instance_exec'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/initiali
zable.rb:30:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/initiali
zable.rb:55:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/initiali
zable.rb:54:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/initiali
zable.rb:54:in `run_initializers'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/applicat
ion.rb:96:in `initialize!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/railtie/
configurable.rb:30:in `send'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/railtie/
configurable.rb:30:in `method_missing'
from C:/Users/Edu/workspace/tasks/config/environment.rb:5
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/applicat
ion.rb:83:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/applicat
ion.rb:83:in `require_environment!'
from C:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/commands
.rb:22
from script/rails:6:in `require'
from script/rails:6
From reading other problems, it has to do with 1.8 not understanding some of the syntax of rails 3.1. My question is, are there any resources for getting this resolved? I really like to added speed of 1.8.7 in my development and testing of apps. if not, are there any other suggestions to speed up my development?
You (or someone else) has generated the application using Ruby 1.9. This means that it is using the new-to-1.9 variant of hashes (
key: value) rather than the 1.8 version (:key => value).You will need to update this to be the latter inside
config/initializers/session_store.rbif you want to use this application on 1.8.7.