ruby-on-rails - rails : Your user account isn't allowed to install to the system RubyGems

标签 ruby-on-rails ruby rubygems bundler gemfile

我正在运行命令

bundle install

在项目文件夹中。在某些项目文件夹中,它会产生错误,而在其他项目文件夹中,它不会产生错误。错误是:

Your user account isn't allowed to install to the system RubyGems

我知道这可以通过遵循推荐的建议来解决:

bundle install --path vendor/bundle

我的问题是为什么行为不一致?

最佳答案

在我的例子中,我按照错误消息的建议解决了问题:

Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/

So, instead of:

bundle install

我跑了:

bundle install --path vendor/bundle

这就是 this guy 的解决方案.

该解决方案的缺点是它会在当前文件夹中创建一个vendor 文件夹,如果要通过Git 分发应用程序,可以将其添加到.gitignore .

关于ruby-on-rails - rails : Your user account isn't allowed to install to the system RubyGems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42843948/

相关文章:

ruby-on-rails - Ruby on Rails 中 'for' 和 'each' 迭代器之间的区别

ruby - TravisCI Ruby 项目不适用于 rspec

ruby-on-rails - rails : save file from URL and save it to Amazon S3

ruby - 好的 ruby 资源?

ruby - 格式错误的版本号字符串

ruby-on-rails - Bundler - 找不到 gem 的兼容版本

ruby-on-rails - Rails ActiveAdmin,表单页面上的两列(不是边栏)

ruby-on-rails - Docker:Nginx - [emerg] 在上游找不到主机

ruby-on-rails - heroku 运行 rake db :migrate error

ruby - Gem::Ext::BuildError:错误:无法构建 gem native 扩展。架构Linux