“Could not find bundler” error

2019-01-11 00:08发布

When I try to do bundler update I get this error:

.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
`to_specs': Could not find bundler (>= 0) amongst
[rake-0.8.7, rake-0.8.7, rubygems-update-1.8.4] (Gem::LoadError)

I'm new to Ruby, can someone tell me what would cause this? Rake 0.8.7 is installed.

13条回答
Summer. ? 凉城
2楼-- · 2019-01-11 00:33

Can be related to https://github.com/bundler/bundler-features/issues/34 if you are running the command inside another bundle exec. Try using Bundler.with_original_env if that is the case.

查看更多
smile是对你的礼貌
3楼-- · 2019-01-11 00:36

According to this answer to a similar question, it should be enough:

rvmsudo gem install bundler.

Cheers

查看更多
Evening l夕情丶
4楼-- · 2019-01-11 00:38

For anyone encountering this issue with Capistrano: capistrano isn't able to locate the bundler. The reason might be that you installed bundler under some other gemset where the Capistrano isn't even looking.

  1. List your gemsets.

rvm gemset list

  1. Use a particular gemset.

rvm use 'my_get_set'

  1. Install bundler under that gemset.

gem install bundler

Then, try again with the deploy task.

查看更多
放我归山
5楼-- · 2019-01-11 00:39

I had this problem, then I did:

gem install bundle

notice "bundle" not "bundler" solved my problem.

then in your project folder do:

bundle install

and then you can run your project using:

script/rails server
查看更多
6楼-- · 2019-01-11 00:41

The command is bundle update (there is no "r" in the "bundle").

To check if bundler is installed do : gem list bundler or even which bundle and the command will list either the bundler version or the path to it. If nothing is shown, then install bundler by typing gem install bundler.

查看更多
Juvenile、少年°
7楼-- · 2019-01-11 00:41

I had the same problem .. something happened to my bash profile that wasn't setting up the RVM stuff correctly.

Make sure your bash profile has the following line:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Then I ran "source ~/.bash_profile" and that reloaded everything that was in my bash profile.

That seemed to fix it for me.

查看更多
登录 后发表回答