Modern Front-End Development for Rails B7: bin/setup (page xv)

Hi, I just got bitten by this issue when trying to run the initial bin/setup command:

To work with the latest versions I’ve had to lock down the gemfile:
gem “activerecord-postgres_enum”, ‘~> 1.6’

4 Likes

Thanks for catching that, must be that particular combination of versions.

I changed the migration to avoid a db enum:

    # create_enum(:enum_ilk, %w[concert meet_n_greet battle])
    # create_enum(:enum_access, %w[general members vips])

    create_table(:concerts) do |t|
      t.string(:name)
      t.text(:description)
      t.datetime(:start_time)
      t.references(:venue, null: false, foreign_key: true)
      t.text(:genre_tags)
      # t.enum(:ilk, enum_name: :enum_ilk)
      # t.enum(:access, enum_name: :enum_access)
      t.integer :ilk
      t.integer :access

      t.timestamps
    end

and in the model

  # enum ilk: {concert: "concert", meet_n_greet: "meet_n_greet", battle: "battle"}
  # enum access: {general: "general", members: "members", vips: "vips"}
  enum ilk: %w[concert meet_n_greet battle]
  enum access: %w[general members vips]

That’ll also work, it’s not really an issue for any of the other code, maybe it’s worth pulling back to that in the final code in the name of having one less dependency.

1 Like

I got the same with Rails 6.1.0, PostgreSQL 9.6 under Amazon Linux 2.

I’m staggered bewildered how I don’t see anything about the fact that on page 32 it states The code uses Ruby version 2.7.2 yet all the Gem files in the latest download state Ruby 3.0.0.
nrclient-code.zip as of today (SHA265 9739e689b3f94a927e7074f9d311d6b7e067ad773826cd42689c67a14c88956d) has no main directory and bin/setup throws "rbenv" version '3.0.0' is not installed. Can we not get this into Github and iterate faster? Dying to get into this book.

Hi - thanks or your interest. The text was not updated – my mistake – the code uses Ruby 3.0.0, and you should be fine if you install that version.

Where it says main directory, you can start with the turbo_01 directory.

All this has been cleaned up fro the next beta.

Noel

Appreciated, thanks.