-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rails 6.0.0.rc2 install issues #281
Comments
Facing the same issue here! |
Also having this issue! |
Also having this issue. |
Same issue here too. Would welcome advice on how to get around this issue. |
I was able to workaround by placing the css in the stylesheets dir, the js in the javascript dir and adding the appropriate markup to application.html.erb. Still need to fully test it, I'll update this thread w/ any hiccups. |
I've figured out a solution (not a Gem expert so this is pretty "hacky" and will be brittle) ... i) Find file (or equivalent location) : .rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/foundation-rails-6.5.3.0/lib/generators/foundation/install_generator.rb Run "rails g foundation:install" ... hey presto! |
ADDENDUMSo I tried to get Foundations 6's javascript goodness working in Rails 6. Here's what eventually worked for me :- i) Install JQuery (not via the gem) by following these steps -> https://www.botreetechnologies.com/blog/introducing-jquery-in-rails-6-using-webpacker ii) Add "foundation.js" or "foundation.min.js" (in the Foundation downloaded zip file) into javascript/packs. iii) Add "require("packs/foundation.js")" to applications.js in javascript/packs. iv) Uncomment the following in "foundation_and_overrides.css" :- (I also found that adding "$(function () { $(document).foundation();});" to application.js caused an error in the browser console, which I spent ages trying to fix, but just removing it doesn't seem to cause any side effects that I've seen yet). Hopefully this is helpful to someone (or my future self when I forget this!). |
My first experience with foundation and this is what happens. I've been meaning to try it for a while. Sad :( |
I tried this with rails 6.0.2.1, I still get the similiar issues: |
I tried all of @mikenewsletters suggestions above. They were very helpful and got me past the Later I came to needing the i) worked, got jQuery installed. The last part was pivotal:
If I didn't add the // This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
require("@rails/ujs").start()
require("jquery")
require("turbolinks").start()
import { Foundation, Dropdown } from 'foundation-sites';
Foundation.addToJquery($)
$(function(){ $(document).foundation(); }); ... and the So now I've got a split-brained app, with |
Still seems to be an issue. Is is best to ignore this gem completely and just try manually installing |
Day 286. This gem doesn't work with a fresh rails project. WTH? |
There is no elegant way to fix this issue. The root problem is that Sprocket is in its last days. The announcement of its death (deprecation) is very close. In the mean time, everything is for the new kid in the block: webpack. Writing generator with webpack in mind is a daunting task. There are no such thing as a "standard way" to achieve this. And by the way, there is always another config file to edit. What it is true today, 27th. of May of 2020, won't work anymore in 6 months, 1 or 2 years because some config file will be moved in another location, some loader will be replaced by another one and some extra info will be required in a very obscure configuration file located very deep in the /node_modules folder hiearchy. Convention over configuration is not in the gene pool of Webpack or Node. |
I have raised a PR #300 to fix this issue. |
Still a problem~~ |
|
@ycrepeau @Wusinho Although I haven't got chance to write specs for the changes done in the PR, you can be sure about the changes as I am already using it in my running project. |
I'm having problems installing and configuring the foundation-rails gem on Rails6.0.0.rc2
I'm not surprised that the file can not be found as the
javascript folder
has moved up a level so in my code extract the correct file location would be:Can anyone please advise how I can edit the install script to reflect the new paths? also coffeescript is being phased out
The text was updated successfully, but these errors were encountered: