wellcome_공부일기

gem 설치, You don't have ~ 와 Ruby version >= ~ ERROR 해결 본문

ETC.ERROR

gem 설치, You don't have ~ 와 Ruby version >= ~ ERROR 해결

ma_heroine 2021. 9. 2. 21:24

저는 Mac 사용자로,

macOS Mojave version 10.14.6 환경 기준에서의 해결방법입니다.  

 

ruby version을 뭘 사용할지 확실히 정하고 path에 버전 넣으면 혼란스럽지 않을 것 같아요.

 

1. You don't have~ in your path ERROR

(base) Juyeonui-MacBookPro:~ juyeonlee$ gem install --user-install bundler jekyll
Fetching: bundler-2.2.26.gem (100%)
WARNING:  You don't have /Users/juyeonlee/.gem/ruby/2.3.0/bin in your PATH,   gem executables will not run.

아래와 같이 내가 가지고 있지 않은 path를 export해주는 코드를 써준다.

* 여기서 중요한 점은, ruby 버전도 같이 맞춰줄 것!

export PATH="/Users/juyeonlee/.gem/ruby/2.3.0/bin:$PATH" 

-> gem env를 입력하면 GEM PATHS에 추가된 것을 확인할 수 있다.

(base) Juyeonui-MacBookPro:~ juyeonlee$ export PATH="/Users/juyeonlee/.gem/ruby/2.3.0/bin:$PATH"
(base) Juyeonui-MacBookPro:~ juyeonlee$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.2.3
  - RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin18]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.3.0
  - USER INSTALLATION DIRECTORY: /Users/juyeonlee/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/juyeonlee/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-18
  - GEM PATHS:
     - /Library/Ruby/Gems/2.3.0
     - /Users/juyeonlee/.gem/ruby/2.3.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/juyeonlee/.gem/ruby/2.3.0/bin
     - /opt/anaconda3/bin
     - /opt/anaconda3/condabin
     - /Library/Frameworks/Python.framework/Versions/3.8/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/share/dotnet
     - ~/.dotnet/tools

 

2. Ruby version >= ~ ERROR

(base) Juyeonui-MacBookPro:~ juyeonlee$ gem install --user-install bundler jekyll
Successfully installed bundler-2.2.26
Parsing documentation for bundler-2.2.26
Done installing documentation for bundler after 6 seconds
ERROR:  Error installing jekyll:
	jekyll-sass-converter requires Ruby version >= 2.4.0.
1 gem installed

=> 아래와 같이 ruby와 rbenv 버전을 확인해보면 다르다.

(base) Juyeonui-MacBookPro:~ juyeonlee$ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
(base) Juyeonui-MacBookPro:~ juyeonlee$ rbenv versions
  system
* 2.4.4 (set by /Users/juyeonlee/.rbenv/version)
  2.7.2

 

두개를 맞춰주기 위해 export ~ 코드 실행(solution)

* 버전을 확인해보니 2.3 -> 2.4로 업그레이드되었다.

(base) Juyeonui-MacBookPro:~ juyeonlee$ export PATH="$HOME/.rbenv/shims:$PATH"
(base) Juyeonui-MacBookPro:~ juyeonlee$ ruby -v
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin18]

 

그런데!!!!!!(나는)

(base) Juyeonui-MacBookPro:~ juyeonlee$ gem install --user-install bundler jekyll
Fetching: bundler-2.2.26.gem (100%)
WARNING:  You don't have /Users/juyeonlee/.gem/ruby/2.4.0/bin in your PATH,
	  gem executables will not run.

라는 에러가 나와서 다시 1번 ERROR 해결방법을 실행하였다.

그리고 나서야 진짜로 gem install ~ 성공

 

 

Comments