1

I developed my app with the standard configuration (SQLite 3). I want do deploy on heroku and have to change to postgresql.

But I get this error, when trying to migrate my db-schema.

rake db:migrate
rake aborted!
/Users/adrianschnell/Sites/bills_cmd/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
...sion_store :cookie_store, key: '_bills_cmd_session'
                              ^
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:588
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/engine.rb:587
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/adrianschnell/Sites/bills_cmd/config/environment.rb:8
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/application.rb:297:in `initialize_tasks'
Tasks: TOP => db:migrate => environment

I don't know what i have to do now. My Gem File has included 'pg' and my database.yml looks like:

# PostgreSQL v0.8.x
#   gem install pg
development:
  adapter: postgresql
  encoding: unicode
  database: bills_cmd_dev
  pool: 5
  username: adrianschnell
  password:
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
test:
  adapter: postgresql
  encoding: unicode
  database: bills_cmd_test
  pool: 5
  username: adrianschnell
  password:

PostgreSQL is running - via terminal i can access it.

EDIT: I noticed, that I get the following error when trying to create the postgre db:

rake db:create:all
rake aborted!
syntax error on line 18, col 11: `'
/Library/Ruby/Gems/1.8/gems/railties-3.2.11/lib/rails/application/configuration.rb:115:in `database_configuration'
/Library/Ruby/Gems/1.8/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:25
Tasks: TOP => db:create:all => db:load_config
(See full trace by running task with --trace)
Adrian
  • 524
  • 5
  • 21
  • Well, for one, both of these errors are syntax errors in rails, and have nothing to do with Postgres. Regarding the first error - what is line 3 of config/initializers/session_store.rb? As for the second, looks like there are only core files listed in the output - is there any more trace, or any other information for that error? – Scott S Feb 14 '13 at 20:24
  • line #3 in session_store is "BillsCmd::Application.config.session_store :cookie_store, key: '_bills_cmd_session'". yes I think it's only ruby who's making trouble. what's the best way to update ruby on 1.9? using rvm with the command "rvm install current && rvm use current"? – Adrian Feb 14 '13 at 20:56
  • it was not easy... but i got the installation of ruby 1.9.3. I created the postgre manually now and migrated with taps. but when i try to run this RoR application, i get a new error message - i pasted on [pastebin](http://pastebin.com/QkiKcFS6). I even get this message after "bundle install" and "bundle update" – Adrian Feb 14 '13 at 21:33

1 Answers1

0

after hours of searching and testing different suggestions, I tried the ones here: stackoverflow

especially the entry of Darren was the solution for me. Now my RoR App is running with postgre.

Community
  • 1
  • 1
Adrian
  • 524
  • 5
  • 21