Skip to content

Unable to install rspec-rails using README.md instructions #2218

@JoeNyland

Description

@JoeNyland

What Ruby, Rails and RSpec versions are you using?

Ruby version: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
Rails version: Rails 5.2.3
RSpec version: RSpec 3.9

Observed behaviour

diff --git a/Gemfile b/Gemfile
index 0fc37a4..4e8b9d3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -39,6 +39,7 @@ group :development, :test do
   gem 'byebug'
   # Use sqlite3 as the database for Active Record
   gem 'sqlite3', '~> 1.3.6'
+  gem 'rspec-rails', '~> 4.0'
 end
 
 group :test do
  • Then install:
$ bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Could not find gem 'rspec-rails (~> 4.0)' in any of the gem sources listed in your Gemfile.

Expected behaviour

  • rspec-rails installs without errors

Can you provide an example app?

  • N/A as this is easily reproduced in any repo

My research into the issue

Currently, 3.9.0 seems to be the latest available non-prerelease version released:

$ gem search -qre --no-prerelease rspec-rails
rspec-rails (3.9.0)

The pessimistic version constraint won't include prerelease versions of gems, so Bundler is unable to find a version of the gem that matches the version constraint that we're advising users to use in the README.

Assuming that we don't want users to install prerelease versions by default, I think the README has been updated a bit too soon, and until 4.0 is released, the README should instruct users to add gem 'rspec-rails', '~> 3.9' to their Gemfiles.

I'm happy to patch this in a PR, if desired 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions