Rails 3.1部署到Heroku错误

ard*_*vis 13 deployment ruby-on-rails heroku initializer ruby-on-rails-3.1

我正在尝试将我的应用程序部署到Heroku,我之前在我的Windows机器上完成了这个,现在我正在使用mac.

我第一次尝试使用Postgresql.

我的Gemfile中有以下内容:

gem 'pg'
Run Code Online (Sandbox Code Playgroud)

编辑:

AndrewDavis-OSX:lunchbox ardavis$ rvm list

rvm rubies

=> ruby-1.9.2-p180 [ x86_64 ]

AndrewDavis-OSX:lunchbox ardavis$ heroku rake db:migrate
rake aborted!
/app/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
App::Application.config.session_store :cookie_store, key: '_app_session'
                                                        ^

(See full trace by running task with --trace)
(in /app)
Run Code Online (Sandbox Code Playgroud)

如您所见,我正在运行ruby 1.9.2.我的heroku迁移有错误.

编辑2:

刚刚使用Rails 3.1.rc1创建了一个全新的rails应用程序.我将gemfile设置为include

组:制作做宝石'therubyracer-heroku','0.8.1.pre3'gemite'pg'结束

我做了一个快速的git init,提交,然后'heroku create'和'git push heroku master'.一切都很好.然而问题是当我尝试'heroku rake db:migrate'时.我得到了你上面看到的同样的错误.

TEMP FIX编辑:

所以...如果我更改我的config/initializers/session_store.rb

App::Application.config.session_store :cookie_store, key: '_app_session'
Run Code Online (Sandbox Code Playgroud)

App::Application.config.session_store :cookie_store, :key => '_app_session'
Run Code Online (Sandbox Code Playgroud)

并更改我的config/initializers/wrap_parameters.rb

ActionController::Base.wrap_parameters format: [:json]
Run Code Online (Sandbox Code Playgroud)

ActionController::Base.wrap_parameters :format => [:json]
Run Code Online (Sandbox Code Playgroud)

然后我就可以做'heroku rake db:migrate'就好了.任何人都在乎解释为什么这种方式在本地工作原始方式,没有任何修改冒号/哈希?最初的方法是执行'rails new myApp'生成的默认值

ard*_*vis 11

需要迁移Heroku堆栈,您可以运行此命令来执行此操作:

heroku stack:migrate bamboo-mri-1.9.2 
Run Code Online (Sandbox Code Playgroud)

我在本地运行1.9.2,这就是它在本地工作的原因.但是在Heroku上,它的运行速度为1.8.7.