【问题标题】:Make sure that `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` succeeds before bundling在捆绑之前确保 `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` 成功
【发布时间】:2021-07-19 10:15:14
【问题描述】:

我正在尝试在 Visual Studio 代码上安装 ruby​​ 的 byebug gem,每次我尝试使用 bundle install 安装它时,都会出现以下错误:

Errno::EACCES: Permission denied @ rb_sysopen -
/home/ja12tk/vendor/bundle/ruby/2.7.0/gems/byebug-11.1.3/CHANGELOG.md
An error occurred while installing byebug (11.1.3), and Bundler cannot continue.
Make sure that `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` succeeds
before bundling.

这是 Gemfile 所说的:

source "https://rubygems.org"

gem "byebug"
gem "rspec", "~> 3.2.0"

与 Gemfile.lock 一起

GEM
  remote: https://rubygems.org/
  specs:
    byebug (11.1.3)
    diff-lcs (1.4.4)
    rspec (3.2.0)
      rspec-core (~> 3.2.0)
      rspec-expectations (~> 3.2.0)
      rspec-mocks (~> 3.2.0)
    rspec-core (3.2.3)
      rspec-support (~> 3.2.0)
    rspec-expectations (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-mocks (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-support (3.2.2)

PLATFORMS
  ruby

DEPENDENCIES
  byebug
  rspec (~> 3.2.0)

BUNDLED WITH
   2.1.4

我什至尝试过使用“gem install byebug”,但它给了我这个错误:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.7.0 directory.

任何帮助将不胜感激

【问题讨论】:

标签: ruby-on-rails ruby rubygems


【解决方案1】:

我遇到了同样的问题,但我就是这样解决的

我跑了

  • sudo apt-get install ruby​​-dev 在根终端上
  • 然后,捆绑安装在所需的 Gemfile 目录下

就是这样

【讨论】:

    猜你喜欢
    • 2017-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-21
    • 1970-01-01
    • 1970-01-01
    • 2018-12-15
    • 1970-01-01
    相关资源
    最近更新 更多