IT story

확장이 빌드되지 않았기 때문에 GEM 무시

hot-time 2020. 8. 13. 20:47
반응형

확장이 빌드되지 않았기 때문에 GEM 무시


직장과 가정용 컴퓨터 모두에서 최근 .NET을 사용하여 Ruby를 2.3.1로 업그레이드했습니다 ruby-install. 저는 chrubyRuby 스위처로 사용합니다.

터미널에서이 경고를보기 시작했습니다.

Ignoring bcrypt-3.1.11 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.11
Ignoring bcrypt-3.1.10 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.10
Ignoring binding_of_caller-0.7.2 because its extensions are not built.  Try: gem pristine binding_of_caller --version 0.7.2
Ignoring byebug-9.0.5 because its extensions are not built.  Try: gem pristine byebug --version 9.0.5
Ignoring byebug-5.0.0 because its extensions are not built.  Try: gem pristine byebug --version 5.0.0
Ignoring concurrent-ruby-ext-1.0.2 because its extensions are not built.  Try: gem pristine concurrent-ruby-ext --version 1.0.2
Ignoring debug_inspector-0.0.2 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.2

내 작업, 컴퓨터에서 목록은 훨씬 길지만 해결하기 쉽습니다. 제안 된을 시도했을 때 gem pristine GEM보석을 찾을 수 없다는 메시지가 표시되어을 실행 gem install GEM하여 해결했습니다.

집에서는 아무것도 작동하지 않습니다.

상식과 다양한 다른 스택 질문에서 시도한 것 :

  • gem pristine GEM
  • gem pristine --all
  • gem 제거 및 재설치
  • gem update
  • gem update --system
  • bundle update
  • 제거 및 재설치 bundler
  • 제거 및 재설치 rails(하지만 Rails 관련 문제는 아닙니다.)
  • 삭제 ~/.bundle/
  • XCode일부 확장 프로그램을 열고 설치하도록합니다 (필요했지만 수정되지 않았습니다.)
  • 실행 brew doctor후, 모든 사소한 문제를 해결 brew update하고brew upgrade
  • gem install curb (이 보석이이 문제와 어떤 관련이 있는지 상상할 수 없지만 두 명의 다른 사람이 동일한 경고에 대한 수정의 마지막 단계로이를 나열했습니다.)

오늘이 정확한 문제를 발견했습니다-설치되지 않은 보석에 대해 이와 같은 경고를 받았습니다!

... 글쎄요, 보석 설치된 것으로 밝혀졌습니다 -제가 chruby로 활성화 한 것과 다른 루비를 위해 (2.2.3 vs 2.3.1).

모든 다른 루비로 전환하고 모두에서 실행 gem pristine --all하면 문제가 해결되었습니다.


이 문제가 발생하여 이전에 설치된 모든 Ruby 버전을 제거하기까지 위와 동일한 명령을 모두 따랐습니다. 그러나 오류가 지속되었습니다.

.NET의 다양한 (이전에 제거 된) 버전에 대해 남은 gem이있었습니다 ~/.gem/ruby/. 더 이상 사용하지 않는 폴더를 제거한 후 오류가 사라졌습니다.


오늘도이 문제가 있었는데 전체 편집기가 오류 메시지와 함께 빨간색으로 깜박 여서 입력 할 수 없어서 답답했습니다.

정확한 원인은 확실하지 않지만 여러 루비 버전 또는 여러 루비 버전 관리자가 설치 되어 서로 덮어 쓰고 그렇지 않으면 보석에 대한 경로를 엉망으로 만들기 때문 이라고 생각합니다 .

gem당신이 rbenv와 RVM이있을 때 명령은 덮어 쓰기 가져옵니다.

입력하여 설치 한 것을 확인하십시오.

which rvm
which rbenv
which chruby

그중 하나가 설치되어 있으면 경로를 반환합니다. 그런 다음 삭제하고 모든 디렉토리를 완전히 정리하고 새로 설치를 시작하십시오.


없애다

여기 내가 rvm을 위해 한 일이 있습니다 .

rvm implode
gem uninstall rvm
rm -rf ~/.rvm
rm -rf ~/.rvmrc

내가 rbenv를 위해 한 작업 은 다음과 같습니다.

먼저 https://github.com/bernsie/rbenv-clean을 설치 한 다음

rbenv clean
sudo apt-get remove rbenv
rm -rf ~/.rbenv

재설치

그런 다음 작업 할 깨끗한 홈 디렉토리가 있습니다. Ubuntu 14.04에 Ruby 2.1.4를 설치하는 방법으로 rbenv를 다시 설치했습니다 . 그리고 마지막으로;

rbenv rehash

나는 위에서 언급 한 모든 것을했다.

  • xcode-select --install
  • 루비 재설치
  • 모든 보석을 다시 설치
  • gem pristine --all

그러나 문제는 나에게 동일했습니다. 마지막 희망으로 Mac을 재부팅했는데 경고 메시지가 사라졌습니다.

Weird, but if anyone's struggling with this issue after trying everything on StackOverflow, try reboot your machine.


If you have installed RVM, possible you're catching the error because you have installed different versions.

Check and remove useless versions, but I think this is not good approach. Anyway errors gone.

rvm list
rvm use ruby-version
rvm remove ruby-useless-version

After refresh cocoapods, it should be injected in .rvm GEM_HOME

gem uninstall cocoapods
gem install cocoapods

Probably pod COMMAND will throw the error about minitest gem, so – gem install minitest


TL;DR - Ruby gems don't like Rubies running from symlinks or moved from where they were built (because of embedded shebangs)

If the Ruby directory is invoked or environment vars point to a symlink'ed directory, or are copied or renamed, this message is likely. I am using chruby and was symlinking /opt/rubies/ -> /usr/local/ruby/, but Ruby's dynamic library-finding logic doesn't play well with this.

The solution in my case was to replace the symlink with actual rubies in /opt/rubies/ and run gem pristine --all in each Ruby. For others using RVM or Rbenv, good luck with that without starting over from scratch.

This may not be your exact issue, but hopefully it helps.


Uninstall and reinstall of Vagrant also works. There's an unistall.tool bash script included in the installer .dmg image that will remove Vagrant.

Found this solution here: Updating Vagrant and Gems Extentions Not Built In


I had the same issue and I'm using rbenv. For some reason my global rbenv setting went missing. In order to fix this problem I set the global version to one of my rbenv versions... for instance:

rbenv global 2.5.1


This is an old thread, but I just came across this issue myself.

You don't need to restart your machine, you just need to refresh your environment, you can do this with the rehash command:

rehash

From the man page: rehash command re-computes the internal hash table of the contents of directories listed in the path environmental variable to account for new commands added.


This is also a problem when you're developing on Mac and then build a Docker image: https://forums.aws.amazon.com/thread.jspa?messageID=879802&tstart=0

When you do a "bundle install --deployment", bundler will create a vendor directory w/ your gems in it. Note that whilst this includes your gems in the local folder, it will only include the native extensions for your platform. As you're on macOS this will be Darwin. You'll need to do repeat the process on a 64-bit x86 linux environment.


Adding my own flavor here. I use rbenv installed via Homebrew and was getting four of these "ignoring... extensions not built" messages. Specifically:

Ignoring bcrypt-3.1.12 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.12
Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built.  Try: gem pristine byebug --version 10.0.2

I tried many things in this thread with no luck. Finally in my case I did:

  • brew uninstall rbenv
  • rm -rf ~/.rbenv
  • brew install rbenv

At this point I was still getting the errors, but now I had only a single Ruby version to contend with:

$ rbenv versions
* system (set by /Users/will/.rbenv/version)

At this point I tried sudo gem pristine --all but was rejected for permissions on the system Gems directory.

So I went through and ran pristine on each gem, like

sudo gem pristine bcrypt --version 3.1.12 (etc)

And finally the errors were gone.


Libby's suggestion to just start a new terminal session (which she commented on Sebastian Kim's answer) worked for me. Much quicker than any of the others too so I wanted to make it an answer so it was more visible.

참고URL : https://stackoverflow.com/questions/38797458/ignoring-gem-because-its-extensions-are-not-built

반응형