【问题标题】:bundle install - The Gemfile specifies no dependencies - Even though I'm in the directory that contains the Gemfilebundle install - Gemfile 没有指定依赖项 - 即使我在包含 Gemfile 的目录中
【发布时间】:2020-07-20 01:40:40
【问题描述】:

我正在尝试按照指南使用 rspec 进行测试。我使用 bundle init 创建 Gemfile。然后我尝试进行捆绑安装(按照指南)来安装所有的宝石。我确保位于包含 gemfile 的同一文件夹中。但是,我不断得到这个:

Gemfile 没有指定依赖项

捆绑完成! 0 个 Gemfile 依赖项,现在已安装 1 个 gem。

使用 bundle info [gemname] 查看捆绑的 gem 的安装位置。

我的 Gemfile(在我执行 bundle init 之后)如下所示:

frozen_string_literal: true

来源“https://rubygems.org”

git_source(:github) {|repo_name| “https://github.com/#{repo_name}”}

宝石“轨道”

我使用 ruby​​ 2.7.1。

任何帮助将不胜感激。

【问题讨论】:

    标签: ruby rspec gemfile


    【解决方案1】:

    我一步一步地尝试了这个,只有当我没有在我的 Gemfile 中指定任何 gem 时才会出现这个错误。我猜 bundle init 命令 create a Gemfile with gem 'rails' line 被注释掉了。请验证您的 Gemfile 并确保您已在 Gemfile 中添加了至少一个 gem,或者检查 gem 'rails' 行是否仍被注释掉。

    【讨论】:

    • 谢谢。这就是问题所在。当我执行 bundle init 时,“rail”行仍然被注释掉。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 2014-04-23
    • 2012-07-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多