Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5496

Update Getting Started (Rails) tutorial for Rails 7

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 8.1.0, 8.0.3
    • Affects Version/s: None
    • Component/s: Docs

      Rails 7 is the latest version of Rails. Our documentation currently shows how to configure Mongoid for Rails 6. In particular we explain how to install Webpacker, Node.js, and Yarn - which were required for Rails 5 and 6 - but are not required for Rails 7. Rails 7 defaults to Importmap instead of Webpacker.

      We can simplify our documentation by removing the unnecessary steps around installing Webpacker. If someone wants to use Webpacker with Rails 7, they can, but then they can fumble through it using the Rails documentation - which covers this in detail - and we don't have to worry about those complexities.

      Notably when I set up an application using the Rails 7 defaults (other than using Mongoid), I ran into a task failure because Rails 7 uses Imagemap rather than Webpacker. Thus the Webpacker tasks weren't created leading to the failure:

      $ node --version
      $ yarn --version
      $ rails webpacker:install
      rails aborted!
      Don't know how to build task 'webpacker:install' (See the list of available tasks with `rails --tasks`)
      (See full trace by running task with --trace)


            alex.bevilacqua@mongodb.com Alex Bevilacqua
            james.kovacs@mongodb.com James Kovacs
            0 Vote for this issue
            3 Start watching this issue