switched from rbenv from rvm and now not able to r

2019-08-15 08:13发布

FIRST ERROR:

`check_version_conflict': can't activate bundler-1.12.5, already activated bundler-1.13.0.rc.1 (Gem::LoadError)

TURNED INTO THIS ERROR:

/Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/sqlite3-1.3.11/lib/sqlite3.rb:6:in `require': dlopen(/Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.bundle, 9): Library not loaded: /Users/phillipjones/.rvm/rubies/ruby-2.3.1/lib/libruby.2.3.0.dylib (LoadError)
  Referenced from: /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.bundle
  Reason: image not found - /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.bundle

These are the the circumstances leading up to this issue and my steps to try and resolve:

After switching to rbenv from rvm I am having trouble with apps that I created using rvm. I cannot run rails s.

First I got this error:

Phillip-Joness-MacBook:messengerApp phillipjones$ rails s
/Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:2274:in `check_version_conflict': can't activate bundler-1.12.5, already activated bundler-1.13.0.rc.1 (Gem::LoadError)
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:1403:in `activate'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:68:in `block in gem'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:67:in `synchronize'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:67:in `gem'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.0.rc.1/lib/bundler/postit_trampoline.rb:32:in `<top (required)>'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.0.rc.1/lib/bundler/setup.rb:2:in `<top (required)>'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/workspace/messengerApp/config/boot.rb:3:in `<top (required)>'
    from /Users/phillipjones/workspace/messengerApp/bin/rails:8:in `require_relative'
    from /Users/phillipjones/workspace/messengerApp/bin/rails:8:in `<top (required)>'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `load'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `call'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/client/command.rb:7:in `call'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/client.rb:30:in `run'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/bin/spring:49:in `<top (required)>'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `load'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `<top (required)>'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/phillipjones/workspace/messengerApp/bin/spring:13:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

Then I tried bundle update. no change so I tried to install the bundler gem:

Phillip-Joness-MacBook:messengerApp phillipjones$ gem install bundler
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
Done installing documentation for bundler after 5 seconds
1 gem installed

no change.

I tried to install the exact bundler version

Phillip-Joness-MacBook:messengerApp phillipjones$ gem install bundler-1.12.5
ERROR:  Could not find a valid gem 'bundler-1.12.5' (>= 0) in any repository

no change.

I homebrew installed rbenv-bundler

hillip-Joness-MacBook:rubygems phillipjones$ brew install rbenv-bundler
==> Downloading https://github.com/carsomyr/rbenv-bundler/archive/0.99.tar.gz
==> Downloading from https://codeload.github.com/carsomyr/rbenv-bundler/tar.gz/0.99
######################################################################## 100.0%
                

2条回答
Summer. ? 凉城
2楼-- · 2019-08-15 08:35
gem env # to check that everything was pointing at 1.9 and not the system
gem install --no-ri --no-rdoc bundler
rbenv rehash # necessary to load up the bundle executable
bundle --path=vendor/bundle

A combination of rbenv rehash and gem install --no-ri --no-rdoc bundler should be able to solve this problemm. Try the code above and it should solve your problem.

查看更多
倾城 Initia
3楼-- · 2019-08-15 08:35

You have a versions conflict in bundler that was brought on by your specific version install

gem install bundler-1.12.5

this article has a full work through solution for you https://www.jetbrains.com/help/ruby/2016.1/installing-and-uninstalling-gems.html

查看更多
登录 后发表回答