Feature #5638
closedUse Bundler (Gemfile) for gem management
80%
Description
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.
Files
Related issues
Updated by Alexey Palazhchenko over 14 years ago
Second patch updates minimal bundler version, unsticks it and fixes typo in comment. Should be applied after first patch.
Updated by Holger Just over 14 years ago
According to real-life statements Yehuda Katz on the most recent RUG::B 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.
Updated by Alexey Palazhchenko over 14 years ago
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.
Updated by Konstantin Haase over 14 years ago
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.
Updated by Alexey Palazhchenko over 14 years ago
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.
Updated by Eric Davis over 14 years ago
- Priority changed from High to Normal
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).
Updated by Konstantin Haase over 14 years ago
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.
Updated by Eric Davis over 14 years ago
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.
Updated by Konstantin Haase over 14 years ago
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.
Updated by Alexey Palazhchenko over 14 years ago
Per discussion in IRC: target version is 1.1.
Updated by Wayne E. Seguin over 14 years ago
'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
Updated by Jean-Baptiste Barth almost 14 years ago
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.
Updated by Etienne Massip over 13 years ago
Patch updated (includes 'pg' as rails db adapter).
Updated by Etienne Massip over 13 years ago
Updated by Etienne Massip over 13 years ago
- Target version set to Candidate for next major release
Updated by Toshi MARUYAMA over 13 years ago
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
$ 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 setYou can download sources, too.
Updated by Etienne Massip over 13 years ago
I've also seen a FR talking about externalizing ruby-ldap.
Updated by Toshi MARUYAMA over 13 years ago
I pushed my github repository branch.
https://github.com/marutosi/redmine/commits/redmine-bundler
$ 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
Updated by Toshi MARUYAMA over 13 years ago
- File redmine-bundler-20110618.diff redmine-bundler-20110618.diff added
- File remove-vendored-gems.20110618.diff.gz remove-vendored-gems.20110618.diff.gz added
I updated patches and pushed my repositories.
These patches are full patches for r6097.
Updated by Jiron Bach over 13 years ago
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.
Updated by Toshi MARUYAMA over 13 years ago
I give up to install on Mingw Ruby 1.8.6.
$ 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
Updated by Toshi MARUYAMA over 13 years ago
This is an additional patch for mingw to 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.
Updated by Toshi MARUYAMA over 13 years ago
Updated by Toshi MARUYAMA over 13 years ago
- File bundler-full-r6631.patch bundler-full-r6631.patch added
- % Done changed from 0 to 50
I cherry-picked following revisions from ChiliProject and rebased on r6631.
- Fix string encodings coming from sqlite3 in MRI 1.9.x
- Read Gemfile.local for local gem inclusions.
- Add ruby-debug as test dependency to debug failing tests
- Rip faster_csv out of lib into the Gemfile.
I attach the full patch for r6631.
You need to delete vendor/gems by hand after applying this patch.
Updated by Etienne Massip over 13 years ago
Do you plan to merge these changes to your github rails-3.1 branch ?
Updated by Toshi MARUYAMA over 13 years ago
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.
Updated by Toshi MARUYAMA about 13 years ago
- File bundler-20111019-full-r7628.diff bundler-20111019-full-r7628.diff added
- % Done changed from 50 to 70
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: Mercurial: Changes from note 26.- remove coderay version from Gemfile
- minor change of mingw
- use rmagick on only Linux Ruby 1.8 (mri_18)
- It is difficut to install it with bundler on Windows
Updated by Toshi MARUYAMA almost 13 years ago
- Tracker changed from Patch to Feature
Updated by Toshi MARUYAMA almost 13 years ago
- File bundler-r8745.diff bundler-r8745.diff added
- % Done changed from 70 to 80
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:
Mercurial:Updated by Toshi MARUYAMA almost 13 years ago
- File bundler-r8759.diff bundler-r8759.diff added
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://github.com/marutosi/redmine/commits/bundler-20120203
Mercurial:
Updated by Toshi MARUYAMA almost 13 years ago
- File bundler-r8864.diff bundler-r8864.diff added
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.
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'
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://github.com/marutosi/redmine/commits/bundler-20120213
Mercurial:
Updated by Jean-Philippe Lang almost 13 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Target version changed from Candidate for next major release to 1.4.0
- Resolution set to Fixed
Redmine now uses Bundler.
Toshi MARUYAMA wrote:
SQLite3 1.2 on Windows Mingw Ruby 1.8.7 have problems.
https://www.chiliproject.org/issues/864On 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...
Updated by Jean-Philippe Lang almost 13 years ago
Jean-Philippe Lang wrote:
Random failures (including the one you mention) occur with ruby-1.8.7-p358 and mysql.
Fixed in r8909.
Updated by Ivan Cenov almost 13 years ago
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.