Ruby on rails 本地版本有效,但生产版本无效

Ruby on rails 本地版本有效,但生产版本无效,ruby-on-rails,heroku,ruby-on-rails-3.2,Ruby On Rails,Heroku,Ruby On Rails 3.2,上下文 最初,我的应用程序在本地服务器和生产服务器Heroku上都正常工作。然后我做了一个改变,我过早地把它推给了希罗库;该更改在生产时破坏了版本,导致显示500错误。该应用程序仍在我的本地服务器上运行 为了解决这个问题,我运行了heroku rollback命令,以恢复到生产环境中的早期工作版本。生产版本现在正在运行。为了确保我的本地副本和生产副本与工作版本同步,我想我只需运行heroku git:clone-a myapp命令,就可以用工作的生产副本替换本地副本 问题 在将本地副本替换为生产

上下文

最初,我的应用程序在本地服务器和生产服务器Heroku上都正常工作。然后我做了一个改变,我过早地把它推给了希罗库;该更改在生产时破坏了版本,导致显示500错误。该应用程序仍在我的本地服务器上运行

为了解决这个问题,我运行了heroku rollback命令,以恢复到生产环境中的早期工作版本。生产版本现在正在运行。为了确保我的本地副本和生产副本与工作版本同步,我想我只需运行heroku git:clone-a myapp命令,就可以用工作的生产副本替换本地副本

问题

在将本地副本替换为生产中的工作副本后,我尝试推送到Heroku以验证一切正常。我的本地版本仍然正常工作;但是,生产版本只是显示505错误,运行heroku rollback不再回滚到早期的工作版本。如何使生产版本正常工作

为迂回的解释道歉。任何帮助都将不胜感激

档案:

运行heroku logs命令的输出:

更新:

我很好奇创建一个新的Heroku遥控器是否能解决这个问题,所以我删除了它,并将它设置为。不幸的是,问题依然存在

我按照下面的建议运行了“heroku run rake db:migrate”,并获得了以下输出:

heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.6596
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/configuration.rb:115:in `database_configuration'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/base.rb:720:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:25:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)

问题似乎是我的一个CSS文件中有一个打开的注释*/。当我尝试使用以下命令编译资产时,我注意到了这一点:

RAILS_ENV=production bundle exec rake assets:precompile
并且得到了错误

rake aborted!
Invalid CSS after "*/": expected identifier, was "/* Sections"
我删除了无关的*/,强制推送到Heroku git push-f Heroku master,删除了index.html,瞧,正确的页面被提供了


谢谢大家的帮助和推荐

看起来资产管道在部署时不起作用。只要在heroku上推一个新的提交就可以触发一个新的部署。500错误仍然存在。我更新了运行“heroku日志”的输出。这引起了我的注意:“2013-06-05T22:20:29.729040+00:00应用程序[web.1]:ActiveRecord::StatementInvalid PGError:错误:关系学生不存在”。你知道我该怎么解释吗?谢谢heroku运行数据库:migrate@phoet,我运行“heroku run db:migrate”;输出为:正在运行附加到终端的db:version。。。启动,运行.6716 bash:db:version:command未找到它肯定是一个迁移错误。你也在本地运行pg吗?谢谢!这对我帮助很大。我还遇到了一个问题,供应商/资产文件中的CSS文件格式不正确。不幸的是,它位于一个缩小的文件中,因此跟踪丢失的分号有点烦人。
RAILS_ENV=production bundle exec rake assets:precompile
rake aborted!
Invalid CSS after "*/": expected identifier, was "/* Sections"