简体   繁体   English

短语应用和Rails 5正在加载资产

[英]phraseapp and rails 5 loading assets

I have a rails 5 app. 我有一个Rails 5应用程序。 When I load a page I get 当我加载页面时,我得到

Started GET "/assets/application-45dde04378a57c22899ad2b31fae609166d231a52227d7095836a8496b6ab8f6.css" for ::1 at 2016-04-17 15:00:02 +0300 Started GET "/assets/application-105f770c1dac6612cb5efcf55c5a7c64f9115638cbc3e851f6423f55bea5f5f6.js" for ::1 at 2016-04-17 15:00:02 +0300 在2016-04-17 15:00:02 +0300处以:: 1开头的GET“ /assets/application-45dde04378a57c22899ad2b31fae609166d231a52227d7095836a8496b6ab8f6.css”在GET的“ / assets / application-105f770c1dac6612cb5efcf55c5a5c7f1c1f1c1fc1f1c1fc1c1fc1fc1f1c1fc1fc1cfc 17 15:00:02 +0300

When I add phraseapp gem 当我添加phraseapp gem时

gem 'phraseapp-in-context-editor-ruby', '~> 1.0.4'

I get 我懂了

Started GET "/stylesheets/application.css" for ::1 at 2016-04-17 15:00:12 +0300 Started GET "/javascripts/application.js" for ::1 at 2016-04-17 15:00:12 +0300 在2016-04-17 15:00:12 +0300开始:: 1的GET“ /stylesheets/application.css”在2016-04-17 15:00开始:: 1的GET“ /javascripts/application.js” :12 +0300

and the page loads without the css and JS. 并且页面加载时没有CSS和JS。 Can you please help?? 你能帮忙吗?

This might be more work than you want to do, but it's good practice for if you get stuck on problems like this. 这可能比您想做的工作还要多,但是如果您遇到这样的问题,这是个好习惯。

Make a new rails app, install this gem and see if you can reproduce the issue. 制作一个新的Rails应用程序,安装此gem,然后查看是否可以重现该问题。

The good news if you can is that you can pop up your demo app on github and then share it here and also post an issue on the official github project ( https://github.com/phrase/phraseapp-in-context-editor-ruby ). 如果可以的话,好消息是您可以在github上弹出演示应用程序,然后在此处共享它,还可以在官方github项目上发布问题( https://github.com/phrase/phraseapp-in-context-editor -ruby )。

Give that a go, there is just not enough info right now to help out, it does just sound like maybe this gem does not yet support rails 5. Doing it this way you're doing your bit to help open source also. 放手一搏,现在没有足够的信息来提供帮助,听起来好像这颗宝石尚不支持Rails5。这样做是在尽自己最大的努力来帮助开源。

I had to put this lines in application.rb 我不得不把这行放在application.rb

config.assets.paths << Rails.root.join('app', 'assets', 'stylesheets')
config.assets.paths << Rails.root.join('app', 'assets', 'javascripts')
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM