foundation / foundation-rails

Foundation for Rails
foundation.zurb.com
MIT License
1k stars 375 forks source link

Rails 6.1 - application.coffee does not appear to exist #301

Closed wanchic closed 2 months ago

wanchic commented 3 years ago

Rails 6.1.2.1, Ruby 2.7.2, foundation-rails (6.6.2.0), autoprefixer-rails (10.2.4.0)

Running $ rails g foundation:install produces the following error:

The file ~/rails_project/app/assets/javascripts/application.coffee does not appear to exist Rails 6.1 does not have a ../app/assets/javascripts/application.coffee file anymore. I believe all javascript is recommended to be sent to ../app/javascripts/packs/application.js, but maybe I'm wrong?

I "think" got this to work by adding the requested file: ../app/assets/javascripts/application.coffee, and executing rails g foundation:install once again. Once ran, the following was added to that file:

() ->
  $(document).foundation()

While this seemed to get my foundation working, I'm not confident this fixed the issue. While I added the requested gems and ran $ bundle install...:

# Foundation
gem 'foundation-rails'
gem 'autoprefixer-rails'

...during my troubleshooting process, I also installed foundation via yarn...which did not work right out of the box:

$ yarn add foundation-sites 

I'm not sure how/where coffee may have also been installed. It is not found in my Gemfile.lock nor my package.json, nor my yarn.lock

A new process needs to be addressed for Rails 6.1.x

webdev36 commented 3 years ago

I think it is not fixed on the rails 6.x project.