switched from rbenv from rvm and now not able to rails s. can't activate bundler-1.12.5, already activated bundler-1.13.0.rc.1 (Gem::LoadError)

≡放荡痞女 提交于 2019-12-24 07:01:04

问题


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%
🍺  /usr/local/Cellar/rbenv-bundler/0.99: 13 files, 46.6K, built in 10 seconds

installed the bundler again, deleted the gemlock.file and ran a bundle install

Phillip-Joness-MacBook:rubygems 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
Phillip-Joness-MacBook:rubygems phillipjones$ bundle install
Could not locate Gemfile
Phillip-Joness-MacBook:rubygems phillipjones$ cd ~/workspace/messengerApp/
Phillip-Joness-MacBook:messengerApp phillipjones$ bundle install
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using ansi 1.5.0
Using execjs 2.7.0
Using debug_inspector 0.0.2
Using thor 0.19.1
Using sass 3.4.22
Using byebug 9.0.5
Using coderay 1.1.1
Using coffee-script-source 1.10.0
Using concurrent-ruby 1.0.2
Using ffi 1.9.13
Using bundler 1.12.5
Using formatador 0.2.5
Using rb-fsevent 0.9.7
Using ruby_dep 1.3.1
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using multi_json 1.12.1
Using turbolinks-source 5.0.0
Using ruby-progressbar 1.8.1
Using tilt 2.0.5
Using spring 1.7.2
Using sqlite3 1.3.11
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using autoprefixer-rails 6.3.7
Using uglifier 3.0.0
Using binding_of_caller 0.7.2
Using bootstrap-sass 3.2.0.2
Using coffee-script 2.4.1
Using sprockets 3.6.3
Using rb-inotify 0.9.7
Using notiffany 0.1.0
Using pry 0.10.3
Using guard-minitest 2.4.4
Using turbolinks 5.0.0
Using minitest-reporters 1.1.9
Using sdoc 0.4.1
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using listen 3.1.5
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using guard 2.13.0
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.1.1
Using simple_form 3.2.1
Using bootstrap-datepicker-rails 1.6.1.1
Using bootstrap-modal-rails 2.2.5
Using coffee-rails 4.1.1
Using font-awesome-rails 4.6.3.1
Using jquery-rails 4.1.1
Using jquery-turbolinks 2.1.0
Using responders 2.2.0
Using rails 4.2.6
Using sass-rails 5.0.5
Using web-console 2.3.0
Using figaro 0.7.0
Using rails-controller-testing 0.0.3
Bundle complete! 28 Gemfile dependencies, 87 gems now installed.
Gems in the group production were not installed.
Bundled gems are installed into ./vendor/bundle.

then I checked the rbenv local. did a rbenv rehash. checked the rake. and tried rails s again. this time I got a new error:

Phillip-Joness-MacBook:messengerApp phillipjones$ rbenv local
ruby-2.3.1
Phillip-Joness-MacBook:messengerApp phillipjones$ rbenv rehash
Phillip-Joness-MacBook:messengerApp phillipjones$ rbenv which rake
/Users/phillipjones/.rbenv/versions/2.3.1/bin/rake
Phillip-Joness-MacBook:messengerApp phillipjones$ rails ss
/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.2/lib/spring/client/rails.rb:28:in `load'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
    from /Users/phillipjones/workspace/messengerApp/vendor/bundle/gems/spring-1.7.2/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>'

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/38269526/switched-from-rbenv-from-rvm-and-now-not-able-to-rails-s-cant-activate-bundler

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