shusseina

shusseina

Agile Web Development with Rails 7: 'rails new demo' specifying the Rails version has no affect

@rubys

Created the demo app with the following command from page 102:

work>​​ ​​rails​​ ​​new​​ ​​demo​

Examined the installation with the following command from page 104:

​demo>​​ ​​bin/rails​​ ​​about​

Output indicated Rails 7.0.5:

About your application's environment
Rails version             7.0.5

So I deleted the demo directory and ran the command, specifying the version:

rails _7.0.4_ new demo

Command bin/rails about still reports Rails 7.0.5. However, the Gemfile indicates 7.0.4:

gem "rails", "~> 7.0.4"

I presume 7.0.4 vs 7.0.5 is not going to make much of a difference. However, it would be nice to understand what’s going here.

FYI, gem list rails --local output:

*** LOCAL GEMS ***

importmap-rails (1.1.6)
rails (7.0.5, 7.0.4)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.6.0)
sprockets-rails (3.4.2)
stimulus-rails (1.2.1)
turbo-rails (1.4.0)

Marked As Solved

edward-mb

edward-mb

This is how RubyGems Semantic Versioning with Pessimistic version constraint works

gem "rails", "~> 7.0.4" # means >= 7.0.4 and < 7.1

Semantic versioning boils down to:

  • PATCH 0.0.x level changes for implementation level detail changes, such as small bug fixes
  • MINOR 0.x.0 level changes for any backwards compatible API changes, such as new functionality/features
  • MAJOR x.0.0 level changes for backwards incompatible API changes, such as changes that will break existing users code if they update

If you use a version specifier like "~> 7.0.4" bundler will always pick the latest patch of the given version 7.0 of the gem.

Most of the version specifiers, like >= 1.0 , are self-explanatory. The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1 . ~> 2.1 is identical to >= 2.1 and < 3.0 . ~> 2.2.beta will match prerelease versions like 2.2.beta.12 . ~> 0 is identical to >= 0.0 and < 1.0 .

Also Liked

rubys

rubys

Author of Agile Web Development With Rails

I’ve added an explanation and suggested replacing the twiddle-wakka with an equals sign.

Where Next?

Popular Pragmatic Bookshelf topics Top

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New

Other popular topics Top

New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New

Latest in Agile Web Development with Rails 7

Agile Web Development with Rails 7 Portal

Sub Categories: