在总共 0 个 gem(s) 中找不到 'bundler' (>= 0) (Gem::LoadError)

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

我正在尝试在我的虚拟主机上安装 gitlab。这是 Ubuntu 14.04。

介绍告诉我运行命令:

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

但是我总是得到错误:

/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>'

如果我以 root 身份启动 bundle,它会正常工作。

我尝试了很多其他线程中提供的解决方案,例如:

“Could not find bundler” error 要么

等等,但没有解决此错误。 现在我不知道我能做什么。

我的系统:

希望你能帮帮我。

如果您需要任何其他信息,请告诉我。

这是一个非常简单的权限问题。

查看 /usr/local/lib/ruby/gems/2.2.0 是否可以被 root 之外的其他人访问。

如果不这样做:

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

也许该路径无法访问上层或下层文件夹,因此请更改那里的权限。

您可以使用

查找权限
ll YOUR_PATH