Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

684
Visualizações
Ruby on Rails - javascript(s) folder and application.js missing

I'm new to Rails and trying to use some Javascript, but everywhere I go I see application.js mentioned, but it's nowhere to be found in my directories.

I followed the official guide and created a blog. But there is no javascript folder or application.js file under app/assets like I'm expecting.

I'm using Rails 7. During installation, I had errors with the tzinfo-data gem, but fixed it later.

Image of the newly created blog assets folder

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Run this command. rails importmap:install.This should solve the problem.

about 4 years ago · Juan Pablo Isaza Relatório

0

This is what I did. add gem Webpcker to Gem file ran bundle install ran webpacker:install The javascript folder was added under assets. Rails 7

about 4 years ago · Juan Pablo Isaza Relatório

0

Make sure your preferred javascript handling gem is installed successfully. Each gem's corresponding install tasks will add app/javascript/application.js

importmap-rails is installed by default in rails 7. It adds an empty application.js.

Install command: bin/rails importmap:install

https://github.com/rails/importmap-rails/blob/v1.1.0/lib/install/install.rb#L11


jsbundling-rails

Install command: bin/rails javascript:install:[esbuild|rollup|webpack]

https://github.com/rails/jsbundling-rails/blob/v1.0.2/lib/install/install.rb#L24


shackapacker (aka webpacker)

Install command: bin/rails webpacker:install

https://github.com/shakacode/shakapacker/blob/v6.4.1/lib/install/template.rb#L11


You should see this bit when running rails new:

...
         run  bundle binstubs bundler
       rails  importmap:install
Add Importmap include tags in application layout
      insert  app/views/layouts/application.html.erb
Create application.js module as entrypoint
      create  app/javascript/application.js          # <= this one
...
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda