Could not find 'bundler' (>= 0) among 0 total gem(s) (Gem::LoadError)

混江龙づ霸主 提交于 2019-12-11 09:59:51

问题


I'm trying to install gitlab on my vhost. It's an Ubuntu 14.04.

The introduction tells me to run the command:

sudo -u gitlab -H bundle install --deployment --without development test postgres aws kerberos

But than I always get the error:

/usr/local/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 0 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/gitlab/.gem/ruby/2.2.0:/usr/local/lib/ruby/gems/2.2.0', execute `gem env` for more information
    from /usr/local/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
    from /usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
    from /usr/local/bin/bundle:22:in `<main>'
    from /usr/local/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/bin/ruby_executable_hooks:15:in `<main>'

If I start bundle as root it works normally.

I tried a lot of solutions provided in other threads like:

“Could not find bundler” error or Could not find bundler (>= 0) amongst [] (Gem::LoadError) with rails 2.3.18

and so on but nothing resloves this error. Now I have no idea what I could do.

My system:

  • Ubuntu 14.04 (x_64)
  • bundler 1.11.2
  • ruby 2.2.4p230

I hope you can help me out.

If you need any other information please let me know.


回答1:


It's a very simple problem with rights.

Look if /usr/local/lib/ruby/gems/2.2.0 is accessible by others than root.

If not do :

chmod o+x /usr/local/lib/ruby/gems/

Maybe the path isn't accessible a folder up or down, so change permissions there.

You can look for permissions with

ll YOUR_PATH


来源:https://stackoverflow.com/questions/35186427/could-not-find-bundler-0-among-0-total-gems-gemloaderror

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