redmine部署在heroku雪松上 [英] redmine deploy on heroku cedar

查看:167
本文介绍了redmine部署在heroku雪松上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在使用sqlite gem进行部署时遇到了很多问题,所以我一直在试图在heroku cedar上部署redmine 2.0.3。我从Gemefile中删除了所有的sqlite引用,删除了Gemfile.lock,运行了bundle install,并且很高兴推送到了heroku。

我运行了 heroku run rake db:migrate ,然后浏览我的应用程序( http://blooming-river-8784.herokuapp。 )我看到以下内容:

更新! - >当我运行 heroku run rake db:migrate 我得到以下警告信息:

 正在运行rake db:migrate attached to terminal ... up,run.1 
DEPRECATION警告:您在供应商/插件中有Rails 2.3风格的插件!在Rails 4.0中将会删除对这些插件的支持。将它们移出并将它们捆绑到Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (从/ app / Rakefile中的< top(required)>调用:7)
DEPRECATION WARNING:在供应商/插件中有Rails 2.3风格的插件!在Rails 4.0中将会删除对这些插件的支持。将它们移出并将它们捆绑到Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (从/ app / Rakefile中的< top(required)>调用:7)
供应商/插件(/ app / vendor / plugins)中的插件不再被允许。请将您的Redmine插件放在Redmine目录(/ app / plugins)根目录下的`plugins`目录中

应用程序错误
应用程序发生错误,并且您的页面无法送达。请稍后重试。
如果您是应用程序所有者,请查看日志以了解详细信息。

我检查了日志,并看到以下消息:

  2012-07-12T01:34:47 + 00:00 heroku [run.1]:使用命令包启动进程exec rake db:migrate 
2012- 07-12T01:34:47 + 00:00 heroku [run.1]:状态从开始变为
2012-07-12T01:34:53 + 00:00 heroku [run.1]:进程已退出状态为1
2012-07-12T01:34:53 + 00:00 heroku [run.1]:状态从上升到完成
2012-07-12T01:36:03 + 00:00 heroku [router]:错误H10(应用程序崩溃) - > GET blooming-river-8784.herokuapp.com/ dyno = queue = wait = service = status = 503 bytes =



我没有成功搜索这最后一行。所以这就是为什么我张贴在这里希望有人会帮助:)

这是我的Gemfile

  source'http://rubygems.org'

gem'rails','3.2.6'
gem'prototype-rails','3.2.1 '
gemi18n,〜> 0.6.0
gemcoderay,〜> 1.0.6
gemfastercsv,〜> 1.5。 0,:platforms => [:mri_18,::mingw_18,::jruby]
gembuilder

#用于LDAP身份验证的可选gem
组:ldap do
gemnet-ldap ,〜> 0.3.1
end

#OpenID身份验证的可选gem
组:openid do
gemruby-openid,〜> ; 2.1.4,:require => openid
gemrack-openid
结尾

#数据库宝石
平台:mri,:mingw do
组:postgresql do
gempg,> = 0.11.0
结束
结束

平台:jruby do
gemjruby-openssl

group:postgresql do
gemactiverecord-jdbcpostgresql-adapter
end
end

group:development do
gemrdoc ,>> = 2.4.2
gemyard
end

group:test do
gemshoulda,〜> 2.11
gemmocha
end

local_gemfile = File.join(File.dirname(__ FILE__),Gemfile.local)
如果File.exists?( local_gemfile)
putsLoading Gemfile.local ...if $ DEBUG#'ruby -d'或'bundle -v'
instance_eval File.read(local_gemfile)
end

#加载插件'Gemfiles
Dir.glob File.expand_path(../ plugins / * / Gemfile,__FILE__)do | file |如果$ DEBUG#'ruby -d'或'bundle -v'
instance_eval File.read(文件)
结尾
,则
放入Loading#{file} ...


我正在试验同样的问题。

问题出在这里:

https://github.com/redmine/redmine/commit/6fca0289055fae8f066eeb493a590b35e6f26cc0



看起来新插件的警告不只是一个警告,它退出应用程序。无需在app / vendor / plugins中插入任何插件,因为在推送时,heroku会添加它们(在我的情况下,它添加了rails_log_stdout,rails31_enable_runtime_asset_compilation和rails3_serve_static_assets)。

现在最简单的修复方法是在config / environment.rb中注释或删除exit 1行。看起来像一切工作正常。我想这个警告和退出只是某种强烈的弃用警告,但代码仍然可以使用这些插件运行。


I've been banging my head against the wall trying to deploy redmine 2.0.3 on heroku cedar.

I had lots of problems with deploying with sqlite gem so I removed all sqlite references from my Gemefile, deleted Gemfile.lock, ran bundle install, and happily pushed to heroku.

I ran heroku run rake db:migrate and I browsed to my app ( http://blooming-river-8784.herokuapp.com/ ) and I see the following:

UPDATE!! -> when I run heroku run rake db:migrate I get the following warning messages:

Running rake db:migrate attached to terminal... up, run.1
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)
Plugins in vendor/plugins (/app/vendor/plugins) are no longer allowed. Please, put your Redmine plugins in the `plugins` directory at the root of your Redmine directory (/app/plugins)

Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.

I checked the logs and I see the following message:

2012-07-12T01:34:47+00:00 heroku[run.1]: Starting process with command bundle exec rake db:migrate  
2012-07-12T01:34:47+00:00 heroku[run.1]: State changed from starting to up  
2012-07-12T01:34:53+00:00 heroku[run.1]: Process exited with status 1  
2012-07-12T01:34:53+00:00 heroku[run.1]: State changed from up to complete
2012-07-12T01:36:03+00:00 heroku[router]: Error H10 (App crashed) -> GET blooming-river-8784.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=

I googled this last line without sucess. so that's why I'm posting here hoping somebody will help :)

Here is my Gemfile

source 'http://rubygems.org'

gem 'rails', '3.2.6'  
gem 'prototype-rails', '3.2.1'  
gem "i18n", "~> 0.6.0"  
gem "coderay", "~> 1.0.6"  
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]  
gem "builder"  

# Optional gem for LDAP authentication
group :ldap do  
  gem "net-ldap", "~> 0.3.1"  
end  

# Optional gem for OpenID authentication  
group :openid do  
  gem "ruby-openid", "~> 2.1.4", :require => "openid"  
  gem "rack-openid"  
end  

# Database gems  
platforms :mri, :mingw do  
  group :postgresql do  
    gem "pg", ">= 0.11.0"  
  end  
end  

platforms :jruby do  
  gem "jruby-openssl"  

  group :postgresql do  
    gem "activerecord-jdbcpostgresql-adapter"  
  end  
end  

group :development do  
  gem "rdoc", ">= 2.4.2"  
  gem "yard"  
end  

group :test do  
  gem "shoulda", "~> 2.11"  
  gem "mocha"  
end  

local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")  
if File.exists?(local_gemfile)  
  puts "Loading Gemfile.local ..." if $DEBUG # 'ruby -d' or 'bundle -v'
  instance_eval File.read(local_gemfile)  
end  

# Load plugins' Gemfiles  
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|  
  puts "Loading #{file} ..." if $DEBUG # 'ruby -d' or 'bundle -v'  
  instance_eval File.read(file)  
end 

解决方案

I was experimenting the same issue.

The problem comes from here:

https://github.com/redmine/redmine/commit/6fca0289055fae8f066eeb493a590b35e6f26cc0

Looks like the warning for new plugins is not just a warning, it exits the app. It doesn't matter if you don't have any plugins in app/vendor/plugins, because heroku is adding them when you push (in my case it was adding rails_log_stdout, rails31_enable_runtime_asset_compilation and rails3_serve_static_assets).

The easiest fix for now is to comment or remove the "exit 1" line in config/environment.rb. Looks like everything is working fine. I guess this warning&exit is just some kind of hard deprecation warning, but the code can still run with these plugins.

这篇关于redmine部署在heroku雪松上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆