【问题标题】:redmine deploy on heroku cedar在heroku cedar上部署redmine
【发布时间】:2012-07-12 02:14:46
【问题描述】:

我一直在努力在 heroku cedar 上部署 redmine 2.0.3。

我在使用 sqlite gem 进行部署时遇到了很多问题,所以我从我的 Gemefile 中删除了所有 sqlite 引用,删除了 Gemfile.lock,运行 bundle install,并愉快地推送到了 heroku。

我运行 heroku run rake db:migrate 并浏览到我的应用 (http://blooming-river-8784.herokuapp.com/) 并看到以下内容:

更新!! -> 当我运行heroku run rake db:migrate 时,我收到以下警告消息:

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.

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

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=

我用谷歌搜索了最后一行,但没有成功。所以这就是为什么我在这里发帖希望有人能提供帮助:)

这是我的 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 

【问题讨论】:

  • 你从哪里得到的 Gemfile?
  • 是从gihub克隆redmine 2.0.3得到的Gemfile

标签: ruby-on-rails heroku redmine cedar


【解决方案1】:

我正在尝试同样的问题。

问题出在这里:

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”行。看起来一切正常。我猜这个警告和退出只是某种硬性弃用警告,但代码仍然可以使用这些插件运行。

【讨论】:

  • 哇!! @bfcapell 太有帮助了!!现在我可以了解迁移是如何执行的
  • 感谢@iluvcapra,我已经更新了提交链接。看起来 redmine 从他们的仓库中修剪了一些分支。
  • @bfcapell- 非常感谢您的帮助 :) 它让我免于烦恼。
【解决方案2】:

我在我的博客中写过关于如何将 redmine 2 逐步部署到 heroku 的帖子:how to deploy redmine to heroku

【讨论】:

    【解决方案3】:
       gem 'taps'  #Please add to Gemfile. 
    

    【讨论】:

    • 感谢沙密斯的快速回答!但它仍然失败我将gem 'taps'添加到Gemfile,当我推送到heroku时我得到Running: rake assets:precompile rake aborted! could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? Tasks: TOP =&gt; environment,所以我将config.assets.initialize_on_precompile = false添加到config/application.rb并再次推送。这次它推送正确,但是当我浏览我的网站时出现同样的错误,并且在日志中出现同样的消息。
    • group :assets do gem 'therubyracer' gem 'sass-rails', " ~&gt; 3.1.0" gem 'coffee-rails', "~&gt; 3.1.0" gem 'uglifier' end 并运行 bundle install rake assets:precompile
    • 好的。当我捆绑安装并得到Bundler could not find compatible versions for gem “railties” 时,将所有这些添加到我的 Gemfile 中.推送到heroku AAAANNNNDDDD .....失败了!同样Error H10 (App crashed) -&gt; GET blooming-river-8784.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=我真的迷路了。 @Shamith 如果我提供凭据让您登录应用程序并告诉我出了什么问题,那没关系??
    猜你喜欢
    • 2011-12-26
    • 2012-04-29
    • 2011-09-13
    • 1970-01-01
    • 1970-01-01
    • 2012-02-01
    • 1970-01-01
    • 2012-01-10
    • 2012-10-30
    相关资源
    最近更新 更多