简体   繁体   中英

Bundler needs to be installed for each gemset with RVM

Every time I create a new project and attempt to run bundle I am hitting this type of error:

funkdified@funktop ~/rails_projects $ cd blog
ruby-2.2.2 - #gemset created /home/funkdified/.rvm/gems/ruby-2.2.2@blog
ruby-2.2.2 - #generating blog wrappers..........
funkdified@funktop ~/rails_projects/blog $ bundle
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.7, rubygems-bundler-1.4.4, rvm-1.11.3.9] (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /usr/local/bin/bundle:22:in `<main>'

I tried running rvm @global do gem install bundler but this is not working either. Before I can bundle, each time, I need to run gem install bundler first.

Is there something I'm missing? Thanks

You don't have to. Once you have installed bundler within one gemset, you can use that gemset each time you create a new project.

First,

rvm gemset list_all   # will list all the gemset under all the ruby versions you have installed

For example, if you have a gemset named foo under ruby version 2.0.0, and this gemset has already get bundler installed, then each time you create a new project, you can always type this rvm command to use that gemset.

rvm use 2.2.0@foo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM