プロジェクト

全般

プロフィール

Vote #67373

完了

Use Bundler (Gemfile) for gem management

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Gems support_45
対象バージョン:
開始日:
2010/06/02
期日:
進捗率:

80%

予定工数:
category_id:
45
version_id:
40
issue_org_id:
5638
author_id:
5866
assigned_to_id:
1
comments:
36
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Recently I faced two problems with Redmine:

Some of my projects use 'test-unit' gem version 2.0.x. It's (sadly) not fully compatible with test-unit from Ruby distribution (1.x). Running tests against Redmine trunk raises "@uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError)@". That's annoying to uninstall and install this gem again.

Many tests fails or puts warnings like "@DEPRECATION WARNING: using %d in messages is deprecated; use {{count}} instead.. (called from interpolate at /Users/AlekSi/.rvm/gems/ree-1.8.7-2010.01/gems/activerecord-2.3.5/lib/active_record/i18n_interpolation_deprecation.rb:17)@". This is due to new i18n library (0.4.0) loaded instead of version bundled with Rails 2.3.5.

Both problems was solved with Bundler. Check Gemfile in attached patch – it's simple and powerful.


journals

Second patch updates minimal bundler version, unsticks it and fixes typo in comment. Should be applied after first patch.
--------------------------------------------------------------------------------
According to real-life statements "Yehuda Katz":http://yehudakatz.com on the most recent "RUG::B":http://www.rug-b.de/ meeting, even he would not recommend bundler for Rails 2.3.5 projects. It will be properly supported and recommended in Rails 3.0 (with an upgrade path via 2.3.8, see #5603), but I would strongly advise on not using bundler today for Redmine. It's a pain in the ass today.
--------------------------------------------------------------------------------
Holger, may you please be more specific? Why do you against bundler today? Does this patch broke something for you? What the pain?

As for me this patch fixed practical problems, simplified plugins installation process and didn't broke anything.
--------------------------------------------------------------------------------
The main issue is that Bundler + additional Rails/Redmine plugins don't play well at all, as you will be back to manual dependency resolution. Though it does indeed fix the i18n issue. Note that moving to Rails 2.3.8 would, too. I myself simply use another RVM gemset for Redmine development.

Note that RVM and Bundler interfere for some people, which was a concern raised in the Redmine IRC channel (or so I was told0. This is mainly caused by both meddling with the GEM_HOME and GEM_PATH environment variables. Although some people seem to still have issues with using both Bundler and RVM simultaneously, I did not run into any related issues since Bundler 0.9, since both projects are now written in a manner so that they are aware of each other.
--------------------------------------------------------------------------------
Yeah, there were problems with RVM and bundler, but there are no now. RVM gemsets are more buggy (at least for me), and I definitely don't want to use RVM on production server, where I happened to have two different Rails apps. Bundler is a rescue for me.

Proposed patch loads Gemfiles from plugins, if there are any. Redmine developers may stick with specific gem version for patch releases, and upgrade gems with minor and major releases. I believe this will make plugins developers (like me) life easier.
--------------------------------------------------------------------------------
Since Bundler is still pre 1.0 and the Bundler team has make it clear that they have the right to make breaking changes at any time, using Bundler for Redmine is not an option yet. After Bundler reaches 1.0 and has stabilized, we can look into using it with Redmine (along with Rails 3).
--------------------------------------------------------------------------------
Though in that case switching to Bundler on trunk would be an option, as the 1.0 release will probably be done earlier than Redmine's.
--------------------------------------------------------------------------------
Konstantin Haase wrote:
> Though in that case switching to Bundler on trunk would be an option, as the 1.0 release will probably be done earlier than Redmine's.

Redmine's 1.0 RC will be in two weeks. We have already stopped feature development and are fixing the last set of bugs. I think Redmine 1.1 will be released this winter and there's a good chance it will be able to support Rails 3 and Bundler.
--------------------------------------------------------------------------------
Eric Davis wrote:
> Konstantin Haase wrote:
> > Though in that case switching to Bundler on trunk would be an option, as the 1.0 release will probably be done earlier than Redmine's.
>
> Redmine's 1.0 RC will be in two weeks. We have already stopped feature development and are fixing the last set of bugs. I think Redmine 1.1 will be released this winter and there's a good chance it will be able to support Rails 3 and Bundler.

Oh. Ok, my bad.
--------------------------------------------------------------------------------
Per discussion in IRC: target version is 1.1.
--------------------------------------------------------------------------------
'RVM gemsets are more buggy'

This should most definitely not be the case in the latest RVM. All known bugs related to gemset usage have been fixed. I have worked closely with the Bundler team to ensure that RVM gemsets and Bundler 0.9.26+ work very well together.

'I definitely don't want to use RVM on production server'

I find this statement amusing since RVM was developed for the purpose of production servers.

~Wayne
--------------------------------------------------------------------------------
Bundler is now 1.0 and stable, and doesn't use .bundle/ directory anymore, so it might be use-able even with rails 2.3.5 I think. It would be far better than actual manual installs, @rake gems:install@, and hacks on i18n... Please let us know if anybody has an objection.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Patch updated (includes 'pg' as rails db adapter).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
related to "chili#290":https://www.chiliproject.org/issues/290
--------------------------------------------------------------------------------

This is additional patch for redmine_with_bundler_1.0.patch.zip from https://www.chiliproject.org/issues/290

I pushed my bitbucket mercurial repository.
https://bitbucket.org/marutosi/redmine-bundler

<pre>
$ hg clone -U https://bitbucket.org/marutosi/redmine-bundler
$ cd redmine-bundler
$ hg update -r tip
$ LANG=C hg parent
changeset: 4970:5a35cd650de1
branch: redmine-bundler
tag: tip
user: XXXXXXXXXXXXXXX
date: Fri May 13 09:17:29 2011 -0700
summary: [#290] Only print the plugin Gemfile messages when $DEBUG is set

</pre>

You can download sources, too.
* https://bitbucket.org/marutosi/redmine-bundler/get/tip.zip
* https://bitbucket.org/marutosi/redmine-bundler/get/tip.tar.gz
* https://bitbucket.org/marutosi/redmine-bundler/get/tip.tar.bz2

--------------------------------------------------------------------------------
I've also seen a FR talking about externalizing ruby-ldap.
--------------------------------------------------------------------------------
I pushed my github repository branch.
https://github.com/marutosi/redmine/commits/redmine-bundler

<pre>
$ git log -n1 | cat
commit 311610f795f4e134940509dcdb463bed9d3210de
Author: XXXXXXXXXX
Date: Fri May 13 09:17:29 2011 -0700

[#290] Only print the plugin Gemfile messages when $DEBUG is set

--HG--
branch : redmine-bundler-hg-git

</pre>

--------------------------------------------------------------------------------
I updated patches and pushed my repositories.
These patches are full patches for r6097.

* https://bitbucket.org/marutosi/redmine-bundler-bb-20110618
** https://bitbucket.org/marutosi/redmine-bundler-bb-20110618/changeset/6f8c3d3fcfd4
* https://github.com/marutosi/redmine/tree/redmine-bundler-20110618
** https://github.com/marutosi/redmine/commit/1f23c26beebae24406dc47b81005ea6d14cbd263

--------------------------------------------------------------------------------
I have an error message when I start my local application like below: /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/plugin.rb:22:in `inherited': You cannot inherit from Rails::Plugin (RuntimeError). It looks like this message is related to the engine. I asked RubyML about this, it says "there might be a risk that the primary function of 'plugin' which properly works in 2.3 would not be operational in 3.0 engine. In short, I believe the regression occurs in 3.0 in this part. Thus, it is a trend to wait until 3.1 which has the perfect engine function is released". How do you treat this engine? Do you wait until 3.1 release? I do not know how to compile, so need to have your advise on this.
--------------------------------------------------------------------------------

I give up to install on Mingw Ruby 1.8.6.

<pre>
$ ruby --version
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

$ bundle install
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Installing rake (0.9.2)
Using activesupport (2.3.11)
Installing rack (1.1.2)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using bundler (1.0.15)
Installing coderay (0.9.8)
Using edavis10-object_daddy (0.4.3)
Installing hoe (2.10.0) r:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/installer.rb:
170:in `install': hoe requires RubyGems version >= 1.4. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError)
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `install'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `run'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `run'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
... 7 levels...
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from r:/Ruby186/lib/ruby/gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from r:/Ruby186/bin/bundle:19:in `load'
from r:/Ruby186/bin/bundle:19

$ gem update --system
Updating RubyGems
Updating rubygems-update
ERROR: Error installing rubygems-update:
rubygems-update requires Ruby version >= 1.8.7.
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass

</pre>

--------------------------------------------------------------------------------
This is an additional patch for mingw to attachment:redmine-bundler-20110618.diff

I don't install rmagick on Windows, so I need to run "bundle install --without=rmagick".
I can boot Redmine on SQLite3.
I don't install MySQL nor PostgreSQL on Windows.

--------------------------------------------------------------------------------
Related link:
https://www.chiliproject.org/projects/chiliproject/wiki/Bundler
--------------------------------------------------------------------------------
I cherry-picked following revisions from ChiliProject and rebased on r6631.

* Fix string encodings coming from sqlite3 in MRI 1.9.x
** https://www.chiliproject.org/projects/chiliproject/repository/revisions/9c47208efa6a2460dfe26694514f9f8d943fa97b
* Read Gemfile.local for local gem inclusions.
** https://www.chiliproject.org/projects/chiliproject/repository/revisions/a35d61bfb73174468b33ce51c1d711c93882c8c4
* Add ruby-debug as test dependency to debug failing tests
** https://www.chiliproject.org/projects/chiliproject/repository/revisions/c63954a4c73a9cb99be133a93d6d24a4f8139e47
* Rip faster_csv out of lib into the Gemfile.
** https://github.com/chiliproject/chiliproject/commit/9dae76d564a422fd2ef50288ec98778d3e6f56c3
** https://github.com/chiliproject/chiliproject/commit/d8ce7564ceff32a8dbf3775efc18348c35fa2fdd
** https://github.com/chiliproject/chiliproject/commit/0b57e936f533472249c775677e0526b2507676fb

Git:
* https://github.com/marutosi/redmine/commits/bundler-20110825
** https://github.com/marutosi/redmine/commit/bbf9f2b31544645685f0ebbebf111addf8841fd1

Mercurial:
* https://bitbucket.org/marutosi/redmine-bundler-20110825-hg-git
** https://bitbucket.org/marutosi/redmine-bundler-20110825-hg-git/changeset/9305712f4633

I attach the full patch for r6631.
You need to delete vendor/gems by hand after applying this patch.

--------------------------------------------------------------------------------
Do you plan to merge these changes to your github rails-3.1 branch ?
--------------------------------------------------------------------------------
Etienne Massip wrote:
> Do you plan to merge these changes to your github rails-3.1 branch ?

Rails-3.1 branch has already these revisions excluding csv.
Renaming view files (.rhtml to .html.erb) is too hard to merge.
But, I will merge later.
--------------------------------------------------------------------------------

This is the full patch for r7628.

After applying this patch, you need to delete vendor/gems and lib/faster_csv.rb.

I pushed following repositories.

Git:
* https://bitbucket.org/marutosi/redmine-bundler-20111019-git
** https://bitbucket.org/marutosi/redmine-bundler-20111019-git/changeset/950d7b9d4613

* https://github.com/marutosi/redmine/tree/bundler-20111019
** https://github.com/marutosi/redmine/commit/950d7b9d46132b023afaa818685c1746fc742f35

Mercurial:
* https://bitbucket.org/marutosi/redmine-bundler-20111019-hg-git
** https://bitbucket.org/marutosi/redmine-bundler-20111019-hg-git/changeset/df59e57d584b

Changes from note 26.
* remove coderay version from Gemfile
* minor change of mingw
** https://www.chiliproject.org/issues/617
* use rmagick on only Linux Ruby 1.8 (mri_18)
** It is difficut to install it with bundler on Windows

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This is a full patch for r8745.

After applying this patch, you need to delete following directories and files.

* vendor/gems
* vendor/plugins/ruby-net-ldap-0.0.4
* lib/faster_csv.rb

Changes

* update Rails version
* unvendor net-ldap: https://www.chiliproject.org/issues/258
* remove ruby-debug: https://www.chiliproject.org/issues/839

I pushed following repositories.

Git:

* https://bitbucket.org/marutosi/redmine-bundler-20120201-git
** https://bitbucket.org/marutosi/redmine-bundler-20120201-git/changeset/0039a8ec5d00
* https://github.com/marutosi/redmine/commits/bundler-20120201
** https://github.com/marutosi/redmine/commit/0039a8ec5d00

Mercurial:
* https://bitbucket.org/marutosi/redmine-bundler-20120201-hg-git
** https://bitbucket.org/marutosi/redmine-bundler-20120201-hg-git/changeset/3ce4405c38e9

--------------------------------------------------------------------------------
This is a full patch for r8759.

After applying this patch, you need to delete "vendor/gems" and "lib/faster_csv.rb".

Changes:

* adapt r8751 (net-ldap 0.2.2)
* add missing sqlite3 on Windows mingw Ruby 1.9

I pushed following repositories.

Git:

* https://bitbucket.org/marutosi/redmine-bundler-20120203-git
** https://bitbucket.org/marutosi/redmine-bundler-20120203-git/changeset/bbc77dc1f8b4
* https://github.com/marutosi/redmine/commits/bundler-20120203
** https://github.com/marutosi/redmine/commit/bbc77dc1f8b4016fcfa240ae66338ac51b972594

Mercurial:

* https://bitbucket.org/marutosi/redmine-bundler-20120203-hg-git
** https://bitbucket.org/marutosi/redmine-bundler-20120203-hg-git/changeset/7316b4d7e9a0

--------------------------------------------------------------------------------
This is a full patch for r8864.

Changes:

SQLite3 1.2 on Windows Mingw Ruby 1.8.7 have problems.
https://www.chiliproject.org/issues/864

On r8864, following error raises in adding repository.

<pre>
TypeError in RepositoriesController#new

can't convert String into Array

R:/redmine/app/controllers/repositories_controller.rb:39:in `&'
R:/redmine/app/controllers/repositories_controller.rb:39:in `new'
</pre>

SQLite3 1.3 is used on both of Mingw Ruby 1.8 and Ruby 1.9.

I pushed following repositories.

Git:

* https://bitbucket.org/marutosi/redmine-bundler-20120213-git
** https://bitbucket.org/marutosi/redmine-bundler-20120213-git/changeset/bced8cefb553
* https://github.com/marutosi/redmine/commits/bundler-20120213
** https://github.com/marutosi/redmine/commit/bced8cefb553

Mercurial:

* https://bitbucket.org/marutosi/redmine-bundler-20120213-hg-git
** https://bitbucket.org/marutosi/redmine-bundler-20120213-hg-git/changeset/44df1e150acb

--------------------------------------------------------------------------------
Redmine now uses Bundler.

Toshi MARUYAMA wrote:
> SQLite3 1.2 on Windows Mingw Ruby 1.8.7 have problems.
> https://www.chiliproject.org/issues/864
>
> On r8864, following error raises in adding repository.
>
> [...]
>
> SQLite3 1.3 is used on both of Mingw Ruby 1.8 and Ruby 1.9.

This doesn't seem to be related to SQLite3 1.3 but to the latest ruby1.8.7 release. Random failures (including the one you mention) occur with ruby-1.8.7-p358 and mysql.
See error 7 in: http://www.redmine.org/builds/build_trunk-1.8.7-mysql_1489.html
I wanted to upgrade the CI server but it's back to p249...
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> Random failures (including the one you mention) occur with ruby-1.8.7-p358 and mysql.

Fixed in r8909.
--------------------------------------------------------------------------------
I have troubles after this issue and opened a theme in the Help forum: http://www.redmine.org/boards/2/topics/29070. I need help so as to proceed with Redmine.
--------------------------------------------------------------------------------


related_issues

relates,New,6324,requires_redmine_plugin should defer loading plugins if not all dependencies are met
relates,New,8664,Internal Server Error when accessing specific mercurial repository files on PostgreSQL
relates,Closed,8582,RuntimeError (Your PostgreSQL connection does not support unescape_bytea. Try upgrading to pg 0.9.0 or later.)
relates,Closed,4787,Gannt to PNG - CJK (Chinese, Japanese and Korean) characters appear as ?
relates,Closed,7969,Redmine dosn't work with sqlite3-ruby 1.3.3
relates,Closed,9208,Simplify the installation procedure on Windows
duplicates,Closed,8128,Bundler support

Admin Redmine さんが3年以上前に更新

  • カテゴリGems support_45 にセット
  • 対象バージョン1.4.0_40 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0