From ef3b018293343b21dde5a8455f13bece0a66d75c Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 30 Aug 2016 12:00:04 +0200 Subject: [PATCH] Make use of Gemfile groups to avoid changes to Gemfile.lock after 'bundle install'. --- Gemfile | 32 ++++---------------------------- README.md | 9 +++++++-- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Gemfile b/Gemfile index 2b2b0f330..82be9dbc7 100644 --- a/Gemfile +++ b/Gemfile @@ -11,8 +11,10 @@ gem 'activerecord-session_store' gem 'json' -# Gems used only for assets and not required -# in production environments by default. +# Supported DBs +gem 'mysql2', '~> 0.3.20', group: :mysql +gem 'pg', group: :postgres + group :assets do gem 'sass-rails' #, github: 'rails/sass-rails' gem 'coffee-rails' @@ -57,33 +59,8 @@ gem 'libv8' gem 'execjs' gem 'therubyracer' -# Include database gems for the adapters found in the database -# configuration file, thanks to redmine, taken from https://github.com/redmine/redmine/blob/master/Gemfile require 'erb' require 'yaml' -database_file = File.join(File.dirname(__FILE__), 'config/database.yml') -if File.exist?(database_file) - database_config = YAML.load(ERB.new(IO.read(database_file)).result) - adapters = database_config.values.map { |c| c['adapter'] }.compact.uniq - if adapters.any? - adapters.each do |adapter| - case adapter - when 'mysql2' - gem 'mysql2', '~> 0.3.20' - when /postgresql/ - gem 'pg' - when /sqlite3/ - gem 'sqlite3' - else - warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems") - end - end - else - warn('No adapter found in config/database.yml, please configure it first') - end -else - warn('Please configure your config/database.yml first') -end gem 'net-ldap' @@ -128,7 +105,6 @@ group :development, :test do gem 'pre-commit' gem 'rubocop' gem 'coffeelint' - end gem 'puma' diff --git a/README.md b/README.md index 367724ed7..b75e58524 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,13 @@ Getting Started ``` zammad@shell> cd zammad - zammad@shell> gem install rails - zammad@shell> bundle install + zammad@shell> gem install bundler + + # For PostgreSQL (note, the option says "without ... mysql") + zammad@shell> bundle install --without test development mysql + + # For MySQL (note, the option says "without ... postgres") + zammad@shell> bundle install --without test development postgres ``` 3. Configure your databases