jekyll gem reline versions conflict

孤街醉人 提交于 2020-06-29 03:42:30

问题


I tried to create a website using Jekyll.

I used git clone to copy jekyll-theme-hackcss, and then followed instructions from the arch-wiki rubygems page to get the right gem packages.

From inside the cloned folder I used:

$ gem install jekyll
$ gem update
$ gem install bundler
$ bundle config path ~/.gem

/usr/lib/ruby/2.7.0/rubygems.rb:932: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/my_user/.gem/ruby/2.7.0/gems/bundler-1.13.1/lib/bundler/rubygems_integration.rb:486: warning: in `eval'
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
   reline (>= 0)
   Available/installed versions of this gem:
   - 0.1.4
   - 0.1.3 
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.

My want to run bundle exec jekyll serve to run the server locally without having this error.

I tried gem cleanup reline as suggested by the error message but it says it's cleaning up correctly except that the error described comes back.

$ gem list                                                                                                                            

*** LOCAL GEMS ***

addressable (2.7.0)
benchmark (default: 0.1.0)
benchmark-ips (2.8.2)
bigdecimal (default: 2.0.0)
bundler (2.1.4, 1.13.1)
cgi (default: 0.1.0)
colorator (1.1.0)
concurrent-ruby (1.1.6)
csv (3.1.5, default: 3.1.2)
date (3.0.1, default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
em-websocket (0.5.1)
etc (default: 1.1.0)
eventmachine (1.2.7)
fcntl (default: 1.0.0)
ffi (1.13.1)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
forwardable-extended (2.6.0)
gdbm (default: 2.1.0)
getoptlong (default: 0.1.0)
http_parser.rb (0.6.0)
i18n (1.8.3)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
jekyll (4.1.0)
jekyll-feed (0.13.0)
jekyll-sass-converter (2.1.0)
jekyll-seo-tag (2.6.1)
jekyll-watch (2.2.1)
json (default: 2.3.0)
kramdown (2.2.1)
kramdown-parser-gfm (1.1.0)
liquid (4.0.3)
listen (3.2.1)
logger (default: 1.4.2)
lolcat (100.0.1)
matrix (0.3.0, default: 0.2.0)
mercenary (0.4.0)
minima (2.5.1)
minitest (5.14.1)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (2.2.0, default: 2.1.2)
optimist (3.0.1)
ostruct (default: 0.2.0)
paint (2.2.0)
pathutil (0.16.2)
prime (default: 0.1.1)
pstore (default: 0.1.0)
psych (default: 3.1.0)
public_suffix (4.0.5)
racc (1.5.0, default: 1.4.16)
rake-compiler (1.1.0)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
rdoc (6.2.1)
readline (default: 0.0.2)
readline-ext (default: 0.1.0)
reline (0.1.4, default: 0.1.3)
rexml (3.2.4, default: 3.2.3)
rouge (3.20.0)
rspec (3.9.0)
rspec-core (3.9.2)
rspec-expectations (3.9.2)
rspec-mocks (3.9.1)
rspec-support (3.9.3)
rss (0.2.9, default: 0.2.8)
safe_yaml (1.0.5)
sassc (2.4.0)
sdbm (default: 1.0.0)
singleton (default: 0.1.0)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
sync (0.5.0)
term-ansicolor (1.7.1)
terminal-table (1.8.0)
thread_safe (0.3.6)
timeout (default: 0.1.0)
tins (1.25.0)
tracer (default: 0.1.0)
tzinfo (2.0.2, 1.2.7)
unicode-display_width (1.7.0)
uri (default: 0.10.0)
webrick (default: 1.6.0)
yaml (default: 0.1.0)
zlib (default: 1.1.0)

My gem env is:

$ gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.3
  - RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /home/my_user/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /home/my_user/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/2.7.0
     - /home/my_user/.gem/ruby/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--user-install"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/my_user/bin
     - /home/my_user/.gem/ruby/2.7.0/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/local/sbin
     - /opt/cuda/bin
     - /usr/lib/jvm/default/bin
     - /usr/bin/site_perl
     - /usr/bin/vendor_perl
     - /usr/bin/core_perl

What is the problem?


回答1:


There may be one culprit gem here but you will run into this problem again and again unless you fix your underlying approach.

Look at your gems environment; all gems are installed into one folder, regardless of the project you’re working on. So, if you have two projects with conflicting dependencies you will get this problem again.

There are tools, like RVM, which let you create environments for each project. So, each project has its own separate collection of gems and even distinct versions of Ruby if you need 2.7 in one project and 2.5 for another.

See "Easy way to setting Ruby Version Manager (RVM) on projects" for how to use RVM and create a gemset for each project.



来源:https://stackoverflow.com/questions/62510613/jekyll-gem-reline-versions-conflict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!