Project

General

Profile

Actions

task #22

closed

Basic bundler question: You cannot specify the same gem twice with different version requirements.

Added by paddy.doyle almost 5 years ago. Updated over 1 year ago.

Status:
closed
Priority:
support
Assignee:
Target version:
Redmine version:
4.0.x

Description

Hi,

Hopefully this is just a basic bundler/rails question. I have redmine installed, but am not overly familiar with how rails/gems/bundler works.

From looking online, people suggest that you have to edit one or more Gemfiles to get around the error, but I'm not sure if I'm doing something basic that is simpler to fix than that.

I tried to install the issue_recurring plugin following your instructions:

cd plugins
git clone https://github.com/cryptogopher/issue_recurring.git
cd issue_recurring
git checkout tags/1.5
cd ../..
bundle install --verbose

But then hit this error:

[!] There was an error parsing `Gemfile`: 
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: mocha (>= 1.4.0) and mocha (>= 0). Bundler cannot continue.

 #  from /var/www/projects/redmine/redmine-4.0.6/plugins/issue_recurring/Gemfile:3
 #  -------------------------------------------
 #    gem 'web-console'
 >    gem 'mocha'
 #  end
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /var/www/projects/redmine/redmine-4.0.6/Gemfile:101
 #  -------------------------------------------
 #  Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", __FILE__) do |file|
 >    eval_gemfile file
 #  end
 #  -------------------------------------------

Some system details:

OS: Ubuntu 18.04
ruby: 2.5.1
rails: 4.2.10
redmine: 4.0.6

Any help would be welcomed.

Thanks,
Paddy

Actions #1

Updated by cryptogopher almost 5 years ago

  • Status changed from new to feedback
  • Priority changed from feature to support

Thank you for reporting!

It looks like the problem originated due to me having Redmine 3.4 installed from distro package and not Redmine git. My distro version lacked Gemfile parts responsible for development and test environments, so I added necessary gem - mocha - to plugin's Gemfile. Redmine 4.0.6 introduced mocha gem version requirement in Redmine's Gemfile: https://github.com/redmine/redmine/blob/22ebc680ec36d770344dc06bee189cef4b34ea3b/Gemfile#L86 and so the conflict arose.

Knowing that, I fixed my installation used for testing and removed mocha from plugin's Gemfile. It will be valid from next release.

Solution before next release: as mocha is actually only necessary for development purposes, you should be able to bundle install without it, by issuing command:

bundle install --without development test

Please try to run that command instead of bundle install and let me know if it works for you. If yes, I will update README accordingly.

Actions #2

Updated by paddy.doyle almost 5 years ago

Hi,

Thanks for getting back to me so quickly; much appreciated.

I tried bundle install --without development test but it shows the same error:

[!] There was an error parsing `Gemfile`: 
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: mocha (>= 1.4.0) and mocha (>= 0). Bundler cannot continue.

 #  from /var/www/projects/redmine/redmine-4.0.6/plugins/issue_recurring/Gemfile:3
 #  -------------------------------------------
 #    gem 'web-console'
 >    gem 'mocha'
 #  end
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /var/www/projects/redmine/redmine-4.0.6/Gemfile:101
 #  -------------------------------------------
 #  Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", __FILE__) do |file|
 >    eval_gemfile file
 #  end
 #  -------------------------------------------

Should I just remove the 'mocha' entry from the issue_recurring/Gemfile and try again?

Actions #3

Updated by cryptogopher almost 5 years ago

paddy.doyle wrote:

I tried bundle install --without development test but it shows the same error:

[...]

Should I just remove the 'mocha' entry from the issue_recurring/Gemfile and try again?

Yes, please remove it or better comment it out (using #).

Later - before you decide to upgrade plugin - you can just uncomment the line to avoid problems with git checkout while having local changes.

Please let me know if it works.

Actions #4

Updated by paddy.doyle almost 5 years ago

Thanks, I commented it out and the installation worked!

...
Bundle complete! 31 Gemfile dependencies, 59 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into `./vendor/bundle`

But then the next step failed..

$ RAILS_ENV=production rake redmine:plugins:migrate
You must use Bundler 2 or greater with this lockfile.
$ bundler --version
Bundler version 2.0.1
Actions #5

Updated by cryptogopher almost 5 years ago

paddy.doyle wrote:

But then the next step failed..

[...]

I think this is out of scope of the plugin, as plugin does not place any constraints on bundler version. Also I'm using:

$ bundler --version
Bundler version 1.17.3

on both: Redmine 3.4 nd 4.0 testing environments, so I'm not able to reproduce the problem.

But I took a quick search and maybe something like this will help you:
https://github.com/jekyll/jekyll/issues/7463#issuecomment-451686361

I'm leaving this ticket open. If you'll succeed please let us know how. It may be helpful for other users.

Actions #6

Updated by paddy.doyle almost 5 years ago

cryptogopher wrote:

I think this is out of scope of the plugin, as plugin does not place any constraints on bundler version. Also I'm using:

Yep, fair enough.

on both: Redmine 3.4 nd 4.0 testing environments, so I'm not able to reproduce the problem.

But I took a quick search and maybe something like this will help you:
https://github.com/jekyll/jekyll/issues/7463#issuecomment-451686361

Following the instructions in that comment didn't make a difference, but one of my colleagues helped me out with this instead:

bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Feel free to close off this ticket. Thanks for all of your help!

Actions #7

Updated by cryptogopher almost 5 years ago

  • Status changed from feedback to closed

paddy.doyle wrote:

Following the instructions in that comment didn't make a difference, but one of my colleagues helped me out with this instead:

[...]

Well, running through bundle exec makes perfect sense. I have updated README accordingly (https://it.michalczyk.pro/projects/issue-recurring/repository/revisions/3d33a97e88fd65de73be7ba47bb945e8686766d0/diff/README.md?utf8=%E2%9C%93&type=sbs).

Note: you may want to run rake cron task through bundle exec too.

Thank you for contributing! That will definitely be a timesaver for other users.

Actions #8

Updated by admin over 1 year ago

  • Tracker changed from 3 to task
Actions

Also available in: Atom PDF