主要錯誤提示
You cannot specify the same gem twice with different version requirements.
vcard (~> 0.2.8) and vcard (>= 0). Bundler cannot continue
[!] 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: vcard (~> 0.2.8) and vcard (>= 0). Bundler cannot continue.
環境
- Ubuntu 20.04.2LTS server無圖形界面
- Redmine-4.1.1
-
# samxiao @ rm411 in ~/redmine-4.1.1 [18:04:44] $ gem -v 3.1.4 $ ruby -v ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux] $ rake -V rake, version 13.0.3 $ rails -v Rails 5.2.4.2 # samxiao @ rm411 in ~ [18:06:08] $ rails -v Rails 6.1.3
安裝插件redmine_crm-4_3_1-light(redmine_contants)
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [16:53:39] C:130
$ ./sz-install-one-plugins.sh redmine_contacts
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [16:53:39] C:130
$ bundle install
出現錯誤:
$ ./web-demo.sh
[!] 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: vcard (~> 0.2.8) and vcard (>= 0). Bundler cannot continue.
# from /home/samxiao/redmine-4.1.1/plugins/redmine_people/Gemfile:2
# -------------------------------------------
# gem 'redmine_crm'
> gem 'vcard'
# -------------------------------------------
. Bundler cannot continue.
# from /home/samxiao/redmine-4.1.1/Gemfile:101
# -------------------------------------------
# Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", __FILE__) do |file|
> eval_gemfile file
# end
# -------------------------------------------
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [16:53:15] C:100
$ gem list | grep vcard
vcard (0.3.0)
解決過程
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:05:07]
$ cd ..
# samxiao @ rm411 in ~/redmine-4.1.1 [17:05:28]
$ find . -name "Gemfile"
./plugins/redmine_more_previews/converters/cliff/Gemfile
./plugins/redmine_more_previews/converters/zippy/Gemfile
./plugins/redmine_more_previews/Gemfile
./plugins/redmine_contacts/Gemfile
./plugins/redmine_people/Gemfile
./plugins/redmineup_tags/Gemfile
./plugins/redmine_checklists/Gemfile
./plugins/redmine_agile/Gemfile
./Gemfile
# samxiao @ rm411 in ~/redmine-4.1.1 [17:05:30]
$ cat Gemfile | grep vcard
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:42:59]
$ cat redmine_contacts/Gemfile
gem 'redmine_crm'
gem 'vcard', '~> 0.2.8'
gem 'spreadsheet', '~> 0.6.8'
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:43:08]
$ cat redmine_people/Gemfile
gem 'redmine_crm'
gem 'vcard'
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:43:26] C:130
$ cd redmine_people
# samxiao @ rm411 in ~/redmine-4.1.1/plugins/redmine_people [17:44:46]
$ vi Gemfile
# samxiao @ rm411 in ~/redmine-4.1.1/plugins/redmine_people [17:44:52]
$ cat Gemfile
gem 'redmine_crm'
# gem 'vcard'
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:56:50]
$ bundle install
$ rake redmine:plugins:migrate RAILS_ENV=production
看提示似乎是 以下2個文件有衝突
/home/samxiao/redmine-4.1.1/Gemfile
/home/samxiao/redmine-4.1.1/plugins/redmine_people/Gemfile
其實不是,而是
/home/samxiao/redmine-4.1.1/plugins/redmine_contacts/Gemfile
/home/samxiao/redmine-4.1.1/plugins/redmine_people/Gemfile
這2個文件有衝突。 原因應該是/redmine-4.1.1/Gemfile 中先“包含“了redmine_contacts/Gemfile。
解決方法
將版本要求更低的 /home/samxiao/redmine-4.1.1/plugins/redmine_people/Gemfile 中的 註釋掉。
修改前:
gem 'redmine_crm'
gem 'vcard'
修改後:
gem 'redmine_crm'
# gem 'vcard'
最後運行一次
# samxiao @ rm411 in ~/redmine-4.1.1/plugins [17:56:50]
$ bundle install
$ rake redmine:plugins:migrate RAILS_ENV=production