abahgat / redmine_didyoumean

A Redmine plugin to search for possible duplicates when users are about to open new issues.
Other
67 stars 46 forks source link

Implicit dependency on joiner makes the plugin incompatible with Rails 3.2 #69

Closed Androc closed 9 years ago

Androc commented 9 years ago

Hello,

I just tried to install this plugin on this configuration :

Environment:
  Redmine version                2.6.1.stable
  Ruby version                   1.9.3-p194 (2012-04-20) [i486-linux]
  Rails version                  3.2.21
  Environment                    production
  Database adapter               Mysql2

Problem

The installation of the plugin failed because of the dependency to ActiveRecord 4.2.0 while Rails depends on ActiveRecord 3.2.21.

After taking a looking at the Gemfile.lock I saw that the problem comes from joiner which, since his version 0.3.0 (https://rubygems.org/gems/joiner/versions/0.3.0), depends on Rails 4.1 or above.

Real solution

The problem probably came from that I ran bundle update from the plugin's directory, not from the Redmine's root path.

If you made the same mistake, uninstall joiner (gem uninstall joiner) and ran bundle update from you Redmine's root path.

rlisowski commented 9 years ago

I use this plugin with

Environment:
  Redmine version                2.6.0.stable
  Ruby version                   1.9.3-p448 (2013-06-27) [x86_64-linux]
  Rails version                  3.2.21
  Environment                    production
  Database adapter               Mysql2

by default redmine do not care about Gemfile.lock file from plugin. How you install deps?

Androc commented 9 years ago

Gemfile.lock is not the problem, Gemfile.lock is the file which "gave" me the solution.

I saw that it was the joiner gem which asks a too recent version of ActiveRecord.

Could you please take a look at your Gemfile.lock and give me the joiner version you have ?

rlisowski commented 9 years ago

in redmine Gemfile.lock

    joiner (0.2.0)
      activerecord (>= 3.1.0, < 4.1.0)
    thinking-sphinx (3.1.2)
      activerecord (>= 3.1.0)
      builder (>= 2.1.2)
      innertube (>= 1.0.2)
      joiner (>= 0.2.0)
      middleware (>= 0.1.0)
      riddle (>= 1.5.11)
Androc commented 9 years ago

Are you telling me that you installed the plugin fews days ago and you did not have the problem ? The first version 0.3 of joiner was released on 2014/04/19.

Maybe you already installed the gem before and never had to update it.

rlisowski commented 9 years ago

what you mean by "first version 0.3"? I see all versions on rubygems

To make sure everything is working I downloaded fresh redmine and plugin I put plugin into redmine/plugins dir and from redmine dir execute bundle install. No complains. Everything wa installed smoothly.

bundle install result Gemfile.lock

Androc commented 9 years ago

By "first version 0.3" I spoke about "the first version of the 0.3.X serie". The 0.3.0.

The problem does not come from the plugin itself but from the implicit dependency of joiner.

Before you make your test, uninstall joiner because, reading your log of bundle install, I see Using joiner 0.2.0 which means you already have one.

If you don't have joiner, it will install you the last one leading to my problem.

rlisowski commented 9 years ago

fully fresh install https://gist.github.com/korin/b0a6d53f984cbf45ba7e

Androc commented 9 years ago

Apparently you don't have the problem. But it is strange, you don't have the latest version of gems. For example, I have rake 10.4.2 while you have 10.1.1.

I am too new to Ruby/Redmine to understand why the bundler don't try to install you the latest version of joiner if you don't precize it to not do it.

All what I know is that it was my problem was this dependency and I fixed it.

Maybe if I am the only one with this problem (and as I have the solution), we can close this issue.

Androc commented 9 years ago

Does bundle outdated` tells you your joiner is out dated ?

rlisowski commented 9 years ago

yes, and many other gems too

Androc commented 9 years ago

It appears that from where you execute bundle update is important.

I uninstalled joiner (gem uninstall joiner).

I deleted Gemfile.lock of didyoumean plugin.

I ran bundle update from my redmine's root path ==> it installed the joiner 0.2.0.

I ran bundle update from the redmine_didyoumean directory, it updated joiner to 0.3.4.

So I suppose I did that when installed the plugin and that is why I had problem.

Thanks for your help.

rlisowski commented 9 years ago

You should execute bundle only on redmine root dir. Redmine Gemfile gather all Gemfile files from plugin/*/Gemfile.

Androc commented 9 years ago

Yep, with this misadventure, I won't do the same mistake again :)

Thanks again.