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 .

Popular Prag Prog topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
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
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “&gt;...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New

Other popular topics Top

siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
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
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New