Rails 4 production can't find files #333

Closed
connor-t opened this Issue Oct 16, 2013 · 16 comments

Comments

Projects
None yet

This isn't working in production ( ubuntu vps ), development works fine but I get the errors shown below in production

Failed to load resource: the server responded with a status of 404 (Not Found) http://198.211.118.102/assets/admin/ckeditor/config.js?t=D6IE
Failed to load resource: the server responded with a status of 404 (Not Found) http://198.211.118.102/assets/admin/ckeditor/skins/moono/editor.css?t=D6IE
Failed to load resource: the server responded with a status of 404 (Not Found) http://198.211.118.102/assets/admin/ckeditor/lang/en.js?t=D6IE
Failed to load resource: the server responded with a status of 404 (Not Found) http://198.211.118.102/assets/admin/ckeditor/styles.js?t=D6IE
Uncaught [CKEDITOR.resourceManager.load] Resource name "default" was not found at "http://198.211.118.102/assets/admin/ckeditor/styles.js?t=D6IE".

zolzaya commented Oct 18, 2013

Same here :(

tomasv commented Oct 18, 2013

The problem here is that all the CKEditor assets get a digest attached to them and it breaks things in production.

kanfet commented Oct 18, 2013

Same errors.

Got too ...

zolzaya commented Oct 21, 2013

@tomasv Do you fix it?

zolzaya commented Oct 21, 2013

I'm fixed this issue using https://gist.github.com/markbao/6431880 gist. But I have an another problem. ckeditor can't find icons.png.

kanfet commented Oct 21, 2013

We just use another gem https://github.com/tsechingho/ckeditor-rails. It has not feature for uploading attachments\images, but it works. Gem's owner found solution for same issue: https://github.com/tsechingho/ckeditor-rails/blob/master/lib/ckeditor-rails/tasks.rake

Contributor

CodeOfficer commented Oct 23, 2013

same issue here.

Contributor

CodeOfficer commented Oct 30, 2013

I have a pull request which may help with this:

#341

mensfeld commented Nov 7, 2013

same issue here

galetahub closed this Jan 8, 2014

you can try also setting the var CKEDITOR_BASEPATH = '/assets/ckeditor/'; in JS before Ckeditor initialization

Revokee commented Feb 26, 2014

gelatahub , Can you give directions of how to use this gem with ckeditor ? I'm trying to use it but with no luck

I`m trying the following:

NonStupidDigestAssets.whitelist = [/ckeditor\/.*/]

non-stupid-digest-assets works for us too.
Make sure to

$ rm -r public/assets
and
$ rm -r tmp/cache/assets
then
$ rake assets:precompile

if you already compiled your assets before adding the non stupid digest gem

I had the same problem. adding the following file in application.rb seems to solve it

class Application < Rails::Application
    config.assets.precompile += Ckeditor.assets
    config.assets.precompile += %w( ckeditor/* )
    config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
end

nmoore2 commented Mar 14, 2017 edited

The last step in my process was to run:

rake assets:clobber
rake tmp:clear
rake assets:precompile

Then it worked for me.
Source: #707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment