[英]How do I use morris.js with Rails 6 and webpacker?
I'm not new to Rails, but I'm new to Rails 6 & webpacker.我不是 Rails 新手,但我是 Rails 6 和 webpacker 的新手。 I'm trying to integrate morris.js (and raphael.js) into my app.
我正在尝试将 morris.js(和 raphael.js)集成到我的应用程序中。 I've done:
我弄完了:
yarn add raphael
yarn add morris
In app/views/layouts/application.html.erb在 app/views/layouts/application.html.erb
<%= javascript_pack_tag 'raphael' %>
<%= javascript_pack_tag 'morris' %>
This is my error:这是我的错误:
Webpacker can't find raphael in /Users/jarvis/rails/stuper/public/packs/manifest.json. Webpacker 在 /Users/jarvis/rails/stuper/public/packs/manifest.json 中找不到 raphael。 Possible causes:
可能的原因:
webpack -w
or the webpack-dev-server.webpack -w
或 webpack-dev-server,否则您希望为您的环境将 compile 的 webpacker.yml 值设置为 true。got it working by得到它的工作
rm -rf node_modules
yarn install
then i simply added morris-rails and raphael-rails gems然后我简单地添加了 morris-rails 和 raphael-rails gems
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.