【问题标题】:Rails error while migrating to heroku迁移到heroku时出现Rails错误
【发布时间】:2016-10-03 07:53:32
【问题描述】:

当我尝试通过 heroku run rake 迁移到 heroku 我收到以下错误:

Running rake on ⬢ friends-clique... up, run.8185
/app/vendor/bundle/ruby/2.2.0/gems/bootstrap-4.0.0.alpha3/lib/bootstrap/version.rb:2: warning: already initialized constant Bootstrap::VERSION
/app/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/version.rb:2: warning: previous definition of VERSION was here
/app/vendor/bundle/ruby/2.2.0/gems/bootstrap-4.0.0.alpha3/lib/bootstrap/version.rb:3: warning: already initialized constant Bootstrap::BOOTSTRAP_SHA
/app/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/version.rb:3: warning: previous definition of BOOTSTRAP_SHA was here
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /app/config/environments/production.rb:82)
Abort testing: Your Rails environment is running in production mode!

我以为 heroku 是在生产模式下运行的,刚刚发生了什么?

【问题讨论】:

  • 您是否在本地以生产模式运行项目?
  • 你和 Bootstrap 有 gem 冲突,检查你的 gemfile,也试试heroku run bundle install
  • 您正在运行的确切命令是什么?
  • 你的 Heroku 日志是怎么说的?
  • 你在 heroku 上的 RACK_ENVRAILS_ENV 是什么?您可以通过运行heroku config 来获取此信息。

标签: ruby-on-rails heroku database-migration production-environment


【解决方案1】:

使用 heroku 迁移数据库的正确命令是

Heroku run rake db:migrate

这应该可以正常运行。

【讨论】:

    【解决方案2】:

    我认为您可以按照本指南解决您的问题official asset configuration for heroku

    【讨论】:

      猜你喜欢
      • 2012-09-18
      • 2015-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-11
      • 2011-02-17
      • 1970-01-01
      相关资源
      最近更新 更多