【问题标题】:Heroku Deployment and DB Migration IssueHeroku 部署和数据库迁移问题
【发布时间】:2011-07-19 08:49:11
【问题描述】:

我正在尝试将一个简单的框架 Rails 3.0.5(和 Ruby 1.9.2)应用程序部署到 Heroku,但是当我打开网站和尝试迁移数据库时遇到相同的错误。我使用heroku create --stack bamboo-mri-1.9.2 创建了 Heroku 应用程序。一切都在本地运行。

Code: https://github.com/curiousyogurt/SEE
 App: http://stormy-ice-778.heroku.com/
  1. 访问网站时,我收到“应用程序错误”;在日志中,我收到以下错误(后面还有很多其他信息):

    2011-03-20T17:25:31-07:00 app[web.1]: /app/cfde9dd3-c394-45fb-a0ef-72a753e83909/home/.bundle/gems/ruby/1.9.1/gems /railties-3.0.5/lib/rails/railtie/configuration.rb:77:in 'method_missing':#<:application::configuration:0x00000001d398d8> 的未定义方法“action”(NoMethodError)

    堆栈跟踪:gist.github.com/878866

  2. 在执行heroku rake db:migrate 时,出现以下错误:

    rake 中止! # 的未定义方法“动作” /app/44666f97-ad08-444e-9f39-9ca7eb8fdc93/home/.bundle/gems/ruby/1.9.1/gems/railties-3.0.5/lib/rails/railtie/configuration.rb:77:in `method_missing'

    堆栈跟踪:gist.github.com/878870

这是我的 Gemfile(已删除非生产部分):

gem 'rails', '3.0.5'
gem 'haml'
gem 'devise', :git => 'git://github.com/plataformatec/devise',
              :branch => 'master'
gem 'omniauth'

我不知道下一步该去哪里寻找这个问题。任何建议将不胜感激。

【问题讨论】:

  • 你能列出更多的堆栈跟踪吗?
  • 当然。这里是:gist.github.com/878866(上面#1的堆栈跟踪);和gist.github.com/878870(上面#2 的堆栈跟踪)。
  • 再来一个! config/environments/production.rb的内容怎么样?堆栈跟踪指向该文件中的问题。
  • 修复了它。这是production.rb:gist.github.com/878896 ...事实证明,通过注释掉config.action.mailer.default_url_options = { :host =&gt; 'stormy-ice-778.heroku.com' },我能够解决问题。我不太确定为什么会导致问题;有什么想法吗?非常感谢!

标签: ruby-on-rails-3 heroku


【解决方案1】:
config.action.mailer.default_url_options = { :host => 'stormy-ice-778.heroku.com' }

你的config/environments/production.rb应该是

config.action_mailer.default_url_options = { :host => 'stormy-ice-778.heroku.com' }

(将action.mailer 更改为action_mailer)。

【讨论】:

  • 感谢您解决这个问题;我真的很感激。
猜你喜欢
  • 2015-06-16
  • 1970-01-01
  • 2019-04-16
  • 2011-10-19
  • 1970-01-01
  • 2019-01-25
  • 2021-10-19
  • 2018-07-30
  • 1970-01-01
相关资源
最近更新 更多