web-dev-qa-db-ja.com

異なるGem依存関係間の競合を修正する方法

誰かがこれで私を助けることができるかどうか見てみましょう、私は私が何をしているのか分かりません。

サーバーはdebian 8.4で、完全に更新されています。

また、「gem update」を使用して宝石を更新しました。起こり得るエラーと警告はすべて修正されました。

私はredmine_git_hostingをインストールしていますが、これが起こりました:

root@esplx345:/usr/share/redmine# bundle install --without development test
Don't run Bundler as root. Bundler can ask for Sudo if it is needed, and installing your bundle as root will break
this application for all non-root users on this machine.
Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
Your Gemfile lists the gem redcarpet (~> 3.3.2) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Fetching https://github.com/jbox-web/gitolite-rugged.git
Fetching https://github.com/jbox-web/grack.git
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
  In snapshot (Gemfile.lock):
    rack (= 1.5.5)

  In Gemfile:
    Rails (~> 4.1.4) was resolved to 4.1.15, which depends on
      actionpack (= 4.1.15) was resolved to 4.1.15, which depends on
        rack (~> 1.5.2)

    gitlab-grack was resolved to 2.0.0.pre, which depends on
      rack (~> 1.4.1)

    rack-openid was resolved to 1.4.2, which depends on
      rack (>= 1.1.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
root@esplx345:/usr/share/redmine#

私は多くのことをグーグルで試してみましたが、機能する継ぎ目はありません。

私のシステムには次の宝石があります。

root@esplx345:/usr/share/redmine# gem update
Updating installed gems
Nothing to update
root@esplx345:/usr/share/redmine# gem list

*** LOCAL GEMS ***

actionmailer (4.2.6, 4.1.15, 4.1.8)
actionpack (4.2.6, 4.1.15, 4.1.8)
actionpack-action_caching (1.1.1)
actionview (4.2.6, 4.1.15, 4.1.8)
activejob (4.2.6)
activemodel (4.2.6, 4.1.15, 4.1.8)
activerecord (4.2.6, 4.1.15, 4.1.8)
activesupport (4.2.6, 4.1.15, 4.1.8)
arel (7.0.0, 6.0.3, 5.0.1.20140414130214)
atomic (1.1.99, 1.1.16)
awesome_nested_set (3.0.3, 3.0.0)
bigdecimal (1.2.7, default: 1.2.4)
builder (3.2.2)
bundler (1.11.2, 1.7.4)
celluloid (0.17.3, 0.15.2)
celluloid-essentials (0.20.5)
celluloid-extras (0.20.5)
celluloid-fsm (0.20.5)
celluloid-pool (0.20.5)
celluloid-supervision (0.20.5)
coderay (1.1.1, 1.1.0)
coffee-Rails (4.1.1, 4.0.1)
coffee-script (2.4.1, 2.2.0)
coffee-script-source (1.10.0, 1.3.3)
concurrent-Ruby (1.0.1)
erubis (2.7.0)
eventmachine (1.2.0.1, 1.0.3)
execjs (2.6.0, 2.2.1)
fcgi (0.9.2.1)
ffi (1.9.10, 1.9.6)
gitlab-grack (2.0.2)
globalid (0.3.6)
hike (2.1.3, 1.2.1)
hitimes (1.2.3)
i18n (0.7.0, 0.6.9)
io-console (0.4.5, default: 0.4.2)
jbuilder (2.4.1, 2.1.3)
jquery-Rails (4.1.1, 3.1.4, 3.1.2)
json (1.8.3, default: 1.8.1)
listen (3.0.6, 2.4.0)
loofah (2.0.3)
mail (2.6.4, 2.6.1)
mime-types (3.0, 1.25)
mime-types-data (3.2016.0221)
mini_portile2 (2.1.0, 2.0.0)
minitest (5.8.4, 5.4.2, default: 4.7.5)
multi_json (1.11.2, 1.10.1)
mysql2 (0.4.3, 0.3.20, 0.3.16)
net-http-persistent (2.9.4, 2.9)
net-ldap (0.14.0, 0.8.0)
nokogiri (1.6.7.2)
oj (2.15.0, 2.10.3)
pkg-config (1.1.7)
polyglot (0.3.5, 0.3.4)
power_assert (0.2.7)
protected_attributes (1.1.3, 1.0.8)
psych (2.0.17, default: 2.0.5)
rack (1.6.4, 1.5.5, 1.5.2)
rack-openid (1.4.2)
rack-test (0.6.3, 0.6.2)
Rails (4.2.6, 4.1.15, 4.1.8)
Rails-deprecated_sanitizer (1.0.3)
Rails-dom-testing (1.0.7)
Rails-html-sanitizer (1.0.3)
railties (4.2.6, 4.1.15, 4.1.8)
rake (11.1.2, 10.3.2, default: 10.1.0)
rb-fsevent (0.9.7)
rb-inotify (0.9.7, 0.9.5)
rdoc (4.2.2, default: 4.1.0)
redcarpet (3.3.4, 3.1.2)
request_store (1.3.1, 1.1.0)
rmagick (2.15.4, 2.13.2)
Ruby-openid (2.7.0, 2.5.0)
rubygems-update (2.6.3)
sass (3.4.22, 3.4.6)
sass-Rails (5.0.4, 4.0.3)
sdoc (0.4.1)
spring (1.7.1, 1.1.3)
sprockets (3.6.0, 2.12.3)
sprockets-Rails (3.0.4, 2.3.3, 2.1.3)
sqlite3 (1.3.11, 1.3.9)
test-unit (3.1.8, default: 2.1.5.0)
thor (0.19.1)
thread_safe (0.3.5, 0.3.3)
tilt (2.0.2, 1.4.1)
timers (4.1.1, 1.1.0)
treetop (1.6.5, 1.4.15)
turbolinks (2.5.3, 2.2.2)
tzinfo (1.2.2, 1.1.0)
uglifier (3.0.0, 2.5.3)
will_paginate (3.1.0)
yajl-Ruby (1.2.1, 1.2.0)
root@esplx345:/usr/share/redmine#

ご協力いただき誠にありがとうございます。

1
Marc Riera

別のRubyバージョンまたはRailsも同様に異なるプロジェクトがある場合にRVMを使用するのは良い戦略ですが、通常はGemfile.lockのみを削除してbundle installを実行しますすべてが正常に実行されます。

1
brodriguezs

私はRVMを使用しました

手順はここにあります=> http://redmine-git-hosting.io/how-to/install-redmine/#step-2-install-rvm

表示されなくなった場合に備えて、貼り付けをコピーします。

(step 2) Install RVM

Ruby Version Manager (RVM) is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments from interpreters to sets of gems.

root# su - redmine
redmine$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
redmine$ curl -sSL https://get.rvm.io | bash -s stable
Be sure to have this in /home/redmine/.profile :

# Set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
  PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes rvm bin if it exists
if [ -d "$HOME/.rvm/bin" ] ; then
  PATH="$PATH:$HOME/.rvm/bin"
fi

if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
  source "$HOME/.rvm/scripts/rvm"
fi

if [ -s "$HOME/.rvm/scripts/completion" ] ; then
  source "$HOME/.rvm/scripts/completion"
fi
Now you should logout from Redmine user with exit then ‘relogin’ with su - redmine to reload env vars properly.
0
Marc Riera