Reputation: 9351
When I installed rvm it default install ruby 2.2.1
and it is working fine.
I have installed another version rvm install 2.1.0
and installed.
When I use 2.1.0 and run bundle install
I get:
/home/awlad/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler (LoadError)
from /home/awlad/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/bin/bundle:7:in `<main>'
I tried to gem install bundler
give me: ERROR: While executing gem ... (NoMethodError) undefined method
ord' for nil:NilClass`
If I use ruby 2.2.1 then bundle install working.
when I am using rvm use 2.1.0
then which bundle
give me: /usr/bin/bundle
when I am using rvm use 2.2.1
then which bundle
give me: /home/awlad/.rvm/gems/ruby-2.2.1/bin/bundle
Here is the output of gem env
:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.2.1 (2015-02-26 patchlevel 85) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/awlad/.rvm/gems/ruby-2.2.1
- RUBY EXECUTABLE: /home/awlad/.rvm/rubies/ruby-2.2.1/bin/ruby
- EXECUTABLE DIRECTORY: /home/awlad/.rvm/gems/ruby-2.2.1/bin
- SPEC CACHE DIRECTORY: /home/awlad/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/awlad/.rvm/rubies/ruby-2.2.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/awlad/.rvm/gems/ruby-2.2.1
- /home/awlad/.rvm/gems/ruby-2.2.1@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/awlad/.rvm/gems/ruby-2.2.1/bin
- /home/awlad/.rvm/gems/ruby-2.2.1@global/bin
- /home/awlad/.rvm/rubies/ruby-2.2.1/bin
- /home/awlad/.rvm/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
Additional info:
rvm 1.26.11
Bundler version 1.10.6
How can i solve this issue ?
Upvotes: 2
Views: 604
Reputation: 9351
I am answering and accepting this question because someone may get help from this.
After investigating I have found that it is a Ruby bug was fixed here
I had to upgrade ruby version to 2.1.7 to solve this issue.
You can get details from rvm issue tracker.
Upvotes: 1
Reputation: 504
cannot load such file -- bundler (LoadError) This is the error. The bundler is missing for 2.1.0 . Run gem install bundler and then bundle install
Upvotes: 1
Reputation: 34318
When you switch from one ruby version to another using rvm and you get that message, then you should install bundler again:
gem install bundler
bundle install
Upvotes: 2