##// END OF EJS Templates
Use Bundler for gem management (#5638)....
Jean-Philippe Lang -
r8784:9315039e0a95
parent child
Show More
@@ -0,0 +1,78
1 source :rubygems
2
3 gem "rails", "2.3.14"
4 gem "i18n", "~> 0.4.2"
5 gem "coderay", "~> 1.0.0"
6
7 # Optional gem for LDAP authentication
8 group :ldap do
9 gem "net-ldap", "~> 0.2.2"
10 end
11
12 # Optional gem for OpenID authentication
13 group :openid do
14 gem "ruby-openid", "~> 2.1.4", :require => "openid"
15 end
16
17 # Optional gem for exporting the gantt to a PNG file
18 group :rmagick do
19 # RMagick 2 supports ruby 1.9
20 # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
21 # different requirements for the same gem on different platforms
22 gem "rmagick", ">= 2.0.0"
23 end
24
25 # Database gems
26 platforms :mri, :mingw do
27 group :postgresql do
28 gem "pg", "~> 0.9.0"
29 end
30
31 group :sqlite do
32 gem "sqlite3"
33 end
34 end
35
36 platforms :mri_18, :mingw_18 do
37 group :mysql do
38 gem "mysql"
39 end
40 end
41
42 platforms :mri_19, :mingw_19 do
43 group :mysql do
44 gem "mysql2", "~> 0.2.7"
45 end
46 end
47
48 platforms :jruby do
49 gem "jruby-openssl"
50
51 group :mysql do
52 gem "activerecord-jdbcmysql-adapter"
53 end
54
55 group :postgresql do
56 gem "activerecord-jdbcpostgresql-adapter"
57 end
58
59 group :sqlite do
60 gem "activerecord-jdbcsqlite3-adapter"
61 end
62 end
63
64 group :development do
65 gem "rdoc", ">= 2.4.2"
66 end
67
68 group :test do
69 gem "shoulda", "~> 2.10.3"
70 gem "edavis10-object_daddy", :require => "object_daddy"
71 gem "mocha"
72 end
73
74 # Load plugins' Gemfiles
75 Dir.glob File.expand_path("../vendor/plugins/*/Gemfile", __FILE__) do |file|
76 puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
77 instance_eval File.read(file)
78 end
@@ -0,0 +1,20
1 begin
2 require "rubygems"
3 require "bundler"
4 rescue LoadError
5 $stderr.puts "Redmine requires Bundler. Please install it with `gem install bundler`."
6 exit 1
7 end
8
9 if Gem::Version.new(Bundler::VERSION) < Gem::Version.new("1.0.21")
10 $stderr.puts "Redmine requires Bundler 1.0.21 (you're using #{Bundler::VERSION}).\nPlease install a newer version with `gem install bundler`."
11 exit 1
12 end
13
14 begin
15 ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
16 Bundler.setup
17 rescue Bundler::GemNotFound
18 $stderr.puts "Some gems may need to be installed or updated. Please run `bundle install`."
19 exit 1
20 end
@@ -1,13 +1,10
1 1 # Copy this file to additional_environment.rb and add any statements
2 2 # that need to be passed to the Rails::Initializer. `config` is
3 3 # available in this context.
4 4 #
5 5 # Example:
6 6 #
7 7 # config.log_level = :debug
8 # config.gem "example_plugin", :lib => false
9 # config.gem "timesheet_plugin", :lib => false, :version => '0.5.0'
10 # config.gem "aws-s3", :lib => "aws/s3"
11 8 # ...
12 9 #
13 10
@@ -1,119 +1,124
1 1 # Don't change this file!
2 2 # Configure your app in config/environment.rb and config/environments/*.rb
3 3
4 4 if RUBY_VERSION >= '1.9'
5 5 require 'yaml'
6 6 YAML::ENGINE.yamler = 'syck'
7 7 end
8 8
9 9 RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
10 10
11 11 module Rails
12 12 class << self
13 13 def boot!
14 14 unless booted?
15 15 preinitialize
16 16 pick_boot.run
17 17 end
18 18 end
19 19
20 20 def booted?
21 21 defined? Rails::Initializer
22 22 end
23 23
24 24 def pick_boot
25 25 (vendor_rails? ? VendorBoot : GemBoot).new
26 26 end
27 27
28 28 def vendor_rails?
29 29 File.exist?("#{RAILS_ROOT}/vendor/rails")
30 30 end
31 31
32 32 def preinitialize
33 33 load(preinitializer_path) if File.exist?(preinitializer_path)
34 34 end
35 35
36 36 def preinitializer_path
37 37 "#{RAILS_ROOT}/config/preinitializer.rb"
38 38 end
39 39 end
40 40
41 41 class Boot
42 42 def run
43 43 load_initializer
44 Rails::Initializer.class_eval do
45 def load_gems
46 @bundler_loaded ||= Bundler.require :default, Rails.env
47 end
48 end
44 49 Rails::Initializer.run(:set_load_path)
45 50 end
46 51 end
47 52
48 53 class VendorBoot < Boot
49 54 def load_initializer
50 55 require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
51 56 Rails::Initializer.run(:install_gem_spec_stubs)
52 57 Rails::GemDependency.add_frozen_gem_path
53 58 end
54 59 end
55 60
56 61 class GemBoot < Boot
57 62 def load_initializer
58 63 self.class.load_rubygems
59 64 load_rails_gem
60 65 require 'initializer'
61 66 end
62 67
63 68 def load_rails_gem
64 69 if version = self.class.gem_version
65 70 gem 'rails', version
66 71 else
67 72 gem 'rails'
68 73 end
69 74 rescue Gem::LoadError => load_error
70 75 if load_error.message =~ /Could not find RubyGem rails/
71 76 STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
72 77 exit 1
73 78 else
74 79 raise
75 80 end
76 81 end
77 82
78 83 class << self
79 84 def rubygems_version
80 85 Gem::RubyGemsVersion rescue nil
81 86 end
82 87
83 88 def gem_version
84 89 if defined? RAILS_GEM_VERSION
85 90 RAILS_GEM_VERSION
86 91 elsif ENV.include?('RAILS_GEM_VERSION')
87 92 ENV['RAILS_GEM_VERSION']
88 93 else
89 94 parse_gem_version(read_environment_rb)
90 95 end
91 96 end
92 97
93 98 def load_rubygems
94 99 min_version = '1.3.2'
95 100 require 'rubygems'
96 101 unless rubygems_version >= min_version
97 102 $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
98 103 exit 1
99 104 end
100 105
101 106 rescue LoadError
102 107 $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
103 108 exit 1
104 109 end
105 110
106 111 def parse_gem_version(text)
107 112 $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
108 113 end
109 114
110 115 private
111 116 def read_environment_rb
112 117 File.read("#{RAILS_ROOT}/config/environment.rb")
113 118 end
114 119 end
115 120 end
116 121 end
117 122
118 123 # All that for this:
119 124 Rails.boot!
@@ -1,65 +1,59
1 1 # Be sure to restart your web server when you modify this file.
2 2
3 3 # Uncomment below to force Rails into production mode when
4 4 # you don't control web/app server and can't set it the proper way
5 5 # ENV['RAILS_ENV'] ||= 'production'
6 6
7 # Specifies gem version of Rails to use when vendor/rails is not present
8 RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
9
10 7 # Bootstrap the Rails environment, frameworks, and default configuration
11 8 require File.join(File.dirname(__FILE__), 'boot')
12 9
13 10 if RUBY_VERSION >= '1.9' && defined?(Rails) && Rails::VERSION::MAJOR < 3
14 11 Encoding.default_external = 'UTF-8'
15 12 end
16 13
17 14 # Load Engine plugin if available
18 15 begin
19 16 require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
20 17 rescue LoadError
21 18 # Not available
22 19 end
23 20
24 21 Rails::Initializer.run do |config|
25 22 # Settings in config/environments/* take precedence those specified here
26 23
27 24 # Skip frameworks you're not going to use
28 25 # config.frameworks -= [ :action_web_service, :action_mailer ]
29 26
30 27 # Add additional load paths for sweepers
31 28 config.autoload_paths += %W( #{RAILS_ROOT}/app/sweepers )
32 29
33 30 # Force all environments to use the same logger level
34 31 # (by default production uses :info, the others :debug)
35 32 # config.log_level = :debug
36 33
37 34 # Enable page/fragment caching by setting a file-based store
38 35 # (remember to create the caching directory and make it readable to the application)
39 36 # config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache"
40 37
41 38 # Activate observers that should always be running
42 39 # config.active_record.observers = :cacher, :garbage_collector
43 40 config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
44 41
45 42 # Make Active Record use UTC-base instead of local time
46 43 # config.active_record.default_timezone = :utc
47 44
48 45 # Use Active Record's schema dumper instead of SQL when creating the test database
49 46 # (enables use of different database adapters for development and test environments)
50 47 # config.active_record.schema_format = :ruby
51 48
52 49 # Deliveries are disabled by default. Do NOT modify this section.
53 50 # Define your email configuration in configuration.yml instead.
54 51 # It will automatically turn deliveries on
55 52 config.action_mailer.perform_deliveries = false
56 53
57 config.gem 'coderay', :version => '~>1.0.0'
58 config.gem 'net-ldap', :version => '~>0.2.2'
59
60 54 # Load any local configuration that is kept out of source control
61 55 # (e.g. gems, patches).
62 56 if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
63 57 instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
64 58 end
65 59 end
@@ -1,29 +1,25
1 1 # Settings specified here will take precedence over those in config/environment.rb
2 2
3 3 # The test environment is used exclusively to run your application's
4 4 # test suite. You never need to work with it otherwise. Remember that
5 5 # your test database is "scratch space" for the test suite and is wiped
6 6 # and recreated between test runs. Don't rely on the data there!
7 7 config.cache_classes = true
8 8
9 9 # Log error messages when you accidentally call methods on nil.
10 10 config.whiny_nils = true
11 11
12 12 # Show full error reports and disable caching
13 13 config.action_controller.consider_all_requests_local = true
14 14 config.action_controller.perform_caching = false
15 15
16 16 config.action_mailer.perform_deliveries = true
17 17 config.action_mailer.delivery_method = :test
18 18
19 19 config.action_controller.session = {
20 20 :key => "_test_session",
21 21 :secret => "some secret phrase for the tests."
22 22 }
23 23
24 24 # Skip protect_from_forgery in requests http://m.onkey.org/2007/9/28/csrf-protection-for-your-existing-rails-application
25 25 config.action_controller.allow_forgery_protection = false
26
27 config.gem "shoulda", :version => "~> 2.10.3"
28 config.gem "edavis10-object_daddy", :lib => "object_daddy"
29 config.gem "mocha"
@@ -1,97 +1,92
1 1 == Redmine installation
2 2
3 3 Redmine - project management software
4 Copyright (C) 2006-2011 Jean-Philippe Lang
4 Copyright (C) 2006-2012 Jean-Philippe Lang
5 5 http://www.redmine.org/
6 6
7 7
8 8 == Requirements
9 9
10 10 * Ruby 1.8.6 or 1.8.7
11
12 * RubyGems 1.3.7
13
14 * Ruby on Rails 2.3.14 (official downloadable Redmine releases are packaged with
15 the appropriate Rails version)
16
17 * Rack 1.1.2 gem
18
19 * Rake 0.9.2 gem
20
21 * I18n 0.4.2 gem
11 * RubyGems
12 * Bundler >= 1.0.21
22 13
23 14 * A database:
24 15 * MySQL (tested with MySQL 5.1)
25 16 * PostgreSQL (tested with PostgreSQL 8.4)
26 17 * SQLite3 (tested with SQLite 3.6)
27 18
28 19 Optional:
29 * SCM binaries (e.g. svn), for repository browsing (must be available in PATH)
30 * RMagick (to enable Gantt export to png images)
31 * Ruby OpenID Library >= version 2 (to enable OpenID support)
20 * SCM binaries (e.g. svn, git...), for repository browsing (must be available in PATH)
21 * ImageMagick (to enable Gantt export to png images)
32 22
33 23 == Installation
34 24
35 25 1. Uncompress the program archive
36 26
37 2. Create an empty database: "redmine" for example
27 2. Install the required gems by running:
28 bundle install --without development test
29
30 If ImageMagick is not installed on your system, you should skip the installation
31 of the rmagick gem using:
32 bundle install --without development test rmagick
33
34 3. Create an empty utf8 encoded database: "redmine" for example
38 35
39 3. Configure the database parameters in config/database.yml
36 4. Configure the database parameters in config/database.yml
40 37 for the "production" environment (default database is MySQL)
41 38
42 4. Generate a session store secret
39 5. Generate a session store secret
43 40
44 41 Redmine stores session data in cookies by default, which requires
45 42 a secret to be generated. Under the application main directory run:
46 43 rake generate_session_store
47 44
48 5. Create the database structure
45 6. Create the database structure
49 46
50 47 Under the application main directory run:
51 48 rake db:migrate RAILS_ENV="production"
52 49
53 50 It will create all the tables and an administrator account.
54 51
55 6. Setting up permissions (Windows users have to skip this section)
52 7. Setting up permissions (Windows users have to skip this section)
56 53
57 54 The user who runs Redmine must have write permission on the following
58 subdirectories: files, log, tmp & public/plugin_assets (create the last
59 two if they are not yet present).
55 subdirectories: files, log, tmp & public/plugin_assets.
60 56
61 57 Assuming you run Redmine with a user named "redmine":
62 mkdir tmp public/plugin_assets
63 58 sudo chown -R redmine:redmine files log tmp public/plugin_assets
64 59 sudo chmod -R 755 files log tmp public/plugin_assets
65 60
66 7. Test the installation by running the WEBrick web server
61 8. Test the installation by running the WEBrick web server
67 62
68 63 Under the main application directory run:
69 64 ruby script/server -e production
70 65
71 66 Once WEBrick has started, point your browser to http://localhost:3000/
72 67 You should now see the application welcome page.
73 68
74 8. Use the default administrator account to log in:
69 9. Use the default administrator account to log in:
75 70 login: admin
76 71 password: admin
77 72
78 73 Go to "Administration" to load the default configuration data (roles,
79 74 trackers, statuses, workflow) and to adjust the application settings
80 75
81 76 == SMTP server Configuration
82 77
83 78 Copy config/configuration.yml.example to config/configuration.yml and
84 79 edit this file to adjust your SMTP settings.
85 80 Do not forget to restart the application after any change to this file.
86 81
87 82 Please do not enter your SMTP settings in environment.rb.
88 83
89 84 == References
90 85
91 86 * http://www.redmine.org/wiki/redmine/RedmineInstall
92 87 * http://www.redmine.org/wiki/redmine/EmailConfiguration
93 88 * http://www.redmine.org/wiki/redmine/RedmineSettings
94 89 * http://www.redmine.org/wiki/redmine/RedmineRepositories
95 90 * http://www.redmine.org/wiki/redmine/RedmineReceivingEmails
96 91 * http://www.redmine.org/wiki/redmine/RedmineReminderEmails
97 92 * http://www.redmine.org/wiki/redmine/RedmineLDAP
@@ -1,36 +1,37
1 1 Installing gems for testing
2 2 ===========================
3 3
4 Run `rake gems RAILS_ENV=test` to list the required gems. Run
5 `rake gems:install RAILS_ENV=test` to install any missing gems.
4 Remove your .bundle/config if you've already installed Redmine without
5 the test dependencies.
6 Then, run `bundle install`.
6 7
7 8 Running Tests
8 9 =============
9 10
10 11 Run `rake --tasks test` to see available tests.
11 12 `rake test` will run the entire testsuite.
12 13 You can run `ruby test/unit/issue_test.rb` for an each test.
13 14
14 15 Before running tests, you need to configure both development
15 16 and test databases.
16 17
17 18 Creating test repositories
18 19 ===================
19 20
20 21 Redmine supports a wide array of different version control systems.
21 22 To test the support, a test repository needs to be created for each of those.
22 23
23 24 Run `rake --tasks test:scm:setup` for a list of available test-repositories or
24 25 run `rake test:scm:setup:all` to set up all of them
25 26
26 27 Creating a test ldap database
27 28 =============================
28 29
29 30 Redmine supports using LDAP for user authentications. To test LDAP
30 31 with Redmine, load the LDAP export from test/fixtures/ldap/test-ldap.ldif
31 32 into a testing LDAP server. Test that the ldap server can be accessed
32 33 at 127.0.0.1 on port 389.
33 34
34 35 Setting up the test ldap server is beyond the scope of this documentation.
35 36 The OpenLDAP project provides a simple LDAP implementation that should work
36 37 good as a test server.
@@ -1,63 +1,64
1 1 == Redmine upgrade
2 2
3 3 Redmine - project management software
4 Copyright (C) 2006-2011 Jean-Philippe Lang
4 Copyright (C) 2006-2012 Jean-Philippe Lang
5 5 http://www.redmine.org/
6 6
7 7
8 8 == Upgrading
9 9
10 10 1. Uncompress the program archive in a new directory
11 11
12 12 2. Copy your database settings (RAILS_ROOT/config/database.yml)
13 13 and your configuration file (RAILS_ROOT/config/configuration.yml)
14 14 into the new config directory
15 15 Note: before Redmine 1.2, SMTP configuration was stored in
16 16 config/email.yml. It should now be stored in config/configuration.yml.
17 17
18 18 3. Copy the RAILS_ROOT/files directory content into your new installation
19 19 This directory contains all the attached files.
20 20
21 21 4. Copy the folders of the installed plugins and themes into new installation
22 22
23 5. Generate a session store secret
23 5. Install the required gems by running:
24 bundle install --without development test
25
26 If ImageMagick is not installed on your system, you should skip the installation
27 of the rmagick gem using:
28 bundle install --without development test rmagick
29
30 6. Generate a session store secret
24 31
25 32 Redmine stores session data in cookies by default, which requires
26 33 a secret to be generated. Under the new application directory run:
27 34 rake generate_session_store
28 35
29 36 DO NOT REPLACE OR EDIT ANY OTHER FILES.
30 37
31 6. Migrate your database
38 7. Migrate your database
32 39
33 40 If you are upgrading to Rails 2.3.14 as part of this migration, you
34 41 need to upgrade the plugin migrations before running the plugin migrations
35 42 using:
36 43 rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production"
37 44
38 45 Please make a backup before doing this! Under the new application
39 46 directory run:
40 47 rake db:migrate RAILS_ENV="production"
41 48
42 49 If you have installed any plugins, you should also run their database
43 50 migrations using:
44 51 rake db:migrate_plugins RAILS_ENV="production"
45 52
46 7. Clean up
47
48 Clear the cache and the existing sessions by running:
53 8. Clear the cache and the existing sessions by running:
49 54 rake tmp:cache:clear
50 55 rake tmp:sessions:clear
51 56
52 8. Restart the application server (e.g. mongrel, thin, passenger)
57 9. Restart the application server (e.g. mongrel, thin, passenger)
53 58
54 9. Finally go to "Administration -> Roles & permissions" to check/set permissions
59 10. Finally go to "Administration -> Roles & permissions" to check/set permissions
55 60 for new features, if any
56 61
57 == Notes
58
59 * Rails 2.3.14 is required for versions 1.3.x.
60
61 62 == References
62 63
63 64 * http://www.redmine.org/wiki/redmine/RedmineUpgrade
General Comments 0
You need to be logged in to leave comments. Login now