LoginSignup
2

More than 5 years have passed since last update.

Redmine2.xで環境ごとのgemを追加する

Last updated at Posted at 2012-12-26

この記事は最終更新から1年以上経過しています。 気をつけてね。

Redmineを好みのRackupを使いたい、プラグインで使うgemを追加したい。

Gemfileに直接書いたらマージが発生するので、ローカル用・プラグイン用のGemfileをインクルード出来るようにしてくれている。

Gemfile(redmine)
-- snip --
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

rack関係や、適当に追加したいユーティリティはGemfile.localに記述。
プラグイン独自のgemはplugins/{pluginname}/Gemfileに記述。

という管理をしてbundle。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2