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.

Popular Pragmatic Bookshelf topics Top

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
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
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
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
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Latest in Agile Web Development with Rails 7

Agile Web Development with Rails 7 Portal

Sub Categories: