Chutipong Roobklom
Chutipong Roobklom

Reputation: 3042

Ignoring bcrypt-3.1.11 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.11

In MacOS Sierra [22 Sept 2016]

after upgrade ruby to 5.3.1 via rvm and then checked ruby -v

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]

Then I tried to install rails by using gem

gem install rails -v 5.0.0.1

it shows errors

  Ignoring bcrypt-3.1.11 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.11
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-8.2.2 because its extensions are not built.  Try: gem pristine byebug --version 8.2.2
Ignoring capybara-webkit-1.11.1 because its extensions are not built.  Try: gem pristine capybara-webkit --version 1.11.1
Ignoring debug_inspector-0.0.2 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.2
/Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /Users/chutipongroobklom/.rvm/gems/ruby-2.3.1/gems/io-console-0.4.6/lib/io/console.bundle (fatal)
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/user_interaction.rb:9:in `<top (required)>'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/command.rb:10:in `<top (required)>'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/command_manager.rb:8:in `<top (required)>'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/gem_runner.rb:9:in `<top (required)>'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/chutipongroobklom/.rvm/rubies/ruby-2.3.1/bin/gem:9:in `<main>'
  1. What's going on ?
  2. What is the root cause ?
  3. What should I do next ?
  4. How can I prevent this error in the future ?

Thank you in advance

Upvotes: 1

Views: 8663

Answers (4)

Jacob Benaim
Jacob Benaim

Reputation: 519

gem pristine -a
bundle install
bundle update

solved this for me

I had these lines commented out as well due to a previous try, not sure if it helped.

# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'

Upvotes: 2

Touseef Murtaza
Touseef Murtaza

Reputation: 1956

Reinstall your current gem and issue will be fixed.

In my case, i used

rvm reinstall ruby-2.2.5

Upvotes: 2

Joe
Joe

Reputation: 2010

I just spent the day trying to resolve a similar issue. The issue is probably coming from conflicts in your .gem folder in ~/.gem/ruby from your current ruby version or an older one. To fix this, you can manually delete those folders and re-install your rails gems via: rm -rf ~/.gem/ruby/<ruby_version> gem install bundler bundle install

The folder will be regenerated next time you use that ruby version. If you're using a ruby package manager(ie. Chruby), you should be able to switch ruby versions in your app and see which Ruby versions are coming up with the warning and only delete the gems for that version via the command above.

Other solutions I found suggested running gem pristine -a, on all of your existing ruby versions, but that didn't seem to solve the issue on my end.

Upvotes: 1

rolkos
rolkos

Reputation: 342

Probably during update you have also installed new XCode, it includes libs required to build extensions. But it will not work until you accept XCode licence, and install new components. XCode will do it for you on first run.

So, first run XCode, accept licence, install missing components (XCode should automatically ask if you like to install them).

It might be required to reinstall ruby. (Described here: https://stackoverflow.com/a/16775469/2074939)

Restart console.

If this is first time you install Ruby and Ruby on Rail on your system I recommend reading this: https://gorails.com/setup/osx/10.12-sierra

Upvotes: 2

Related Questions