Works in Dev not in Production Rails 3.2 #87

Closed
ctilley83 opened this Issue Feb 8, 2012 · 36 comments

Comments

Projects
None yet
@ctilley83

Using Rails 3.2 which shouldn't be much difference. It works beautifully in development, however in production, I'm running into some issues. I've compiled my assets, ran bundle install --deployment and I'm getting the following error. I've tried different web servers and webrick doesn't make any difference.

       ActionController::RoutingError (No route matches [GET] "/assets/ckeditor/config.js"):

Any ideas?

@factore

This comment has been minimized.

Show comment
Hide comment

factore commented Feb 9, 2012

+1

@factore

This comment has been minimized.

Show comment
Hide comment
@factore

factore Feb 10, 2012

Looks like there's a temporary workaround at #84

factore commented Feb 10, 2012

Looks like there's a temporary workaround at #84

@mokagio

This comment has been minimized.

Show comment
Hide comment
@mokagio

mokagio Feb 12, 2012

I have the same problem.

The solution posted at #84 doesn't work for me (probably because the problem is different).

Seems 3 files can't get loaded
-config.js
-editor.css
-it.js, which is the localized file for my configuration

If I inspect the content of the public/assets I find the ckeditor folder, with a lot o files inside. But no sign of those 3...
Why?! Why some of the files get trough the assets pipeline and other don't??

So I tried to add those files manually in the pipeline, editing the application.rb. But guess what? There is an error in the editor.css. It's already referenced in #43

Any idea on how to fix this?

mokagio commented Feb 12, 2012

I have the same problem.

The solution posted at #84 doesn't work for me (probably because the problem is different).

Seems 3 files can't get loaded
-config.js
-editor.css
-it.js, which is the localized file for my configuration

If I inspect the content of the public/assets I find the ckeditor folder, with a lot o files inside. But no sign of those 3...
Why?! Why some of the files get trough the assets pipeline and other don't??

So I tried to add those files manually in the pipeline, editing the application.rb. But guess what? There is an error in the editor.css. It's already referenced in #43

Any idea on how to fix this?

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 14, 2012

i wourkarounded this by downloading the ckeditor files to public/javascripts, futher, i did not use javascript_include_tag, i used a explicit script-tag with wired paths, so i was at least able to get it working in prod. hope this helps meanwhile there is no real solution for your problem.

i wourkarounded this by downloading the ckeditor files to public/javascripts, futher, i did not use javascript_include_tag, i used a explicit script-tag with wired paths, so i was at least able to get it working in prod. hope this helps meanwhile there is no real solution for your problem.

@Pepan

This comment has been minimized.

Show comment
Hide comment
@Pepan

Pepan Feb 14, 2012

... or remove wrong css directives and add files to config.assets.precompile

in my production.rb
config.assets.precompile += [ /._ckeditor.js/, /._config.js/, /._cs.js/, /._editor.css/, /._plugin.js/, /._en.js/, /._contents.css/, /._default.js/ ]

  • cs.js is a language file of my nation

Pepan commented Feb 14, 2012

... or remove wrong css directives and add files to config.assets.precompile

in my production.rb
config.assets.precompile += [ /._ckeditor.js/, /._config.js/, /._cs.js/, /._editor.css/, /._plugin.js/, /._en.js/, /._contents.css/, /._default.js/ ]

  • cs.js is a language file of my nation
@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 14, 2012

I too wourkarounded this by downloading ckeditor to public/javascripts, but I'm wondering what's wrong here.

I too wourkarounded this by downloading ckeditor to public/javascripts, but I'm wondering what's wrong here.

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 17, 2012

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'

@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 17, 2012

I did and got a strange result. Something compiled into
public/assets/ckeditor/, jquery and some parts of ckeditor but no
ckeditor.js anywhere.

How did you mounted it?

Francis Yáñez
Nazaríes IT - www.nazaries.com
Av. Constitución 20, Oficina 106 - 18012 Granada
francis.yanez@nazaries.com / Tel: +34.625.617.321

This message may contain confidential and/or privileged information.
If you are neither the addressee nor authorized to receive this for
the addressee, you must not use, copy, disclose or take any action
based on this message or any information herein. If you have received
this message in error, please contact the sender and delete this
message. Thank you.

El 17/02/2012, a las 17:18, Daniel Hanke
reply@reply.github.com
escribió:

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'


Reply to this email directly or view it on GitHub:
#87 (comment)

I did and got a strange result. Something compiled into
public/assets/ckeditor/, jquery and some parts of ckeditor but no
ckeditor.js anywhere.

How did you mounted it?

Francis Yáñez
Nazaríes IT - www.nazaries.com
Av. Constitución 20, Oficina 106 - 18012 Granada
francis.yanez@nazaries.com / Tel: +34.625.617.321

This message may contain confidential and/or privileged information.
If you are neither the addressee nor authorized to receive this for
the addressee, you must not use, copy, disclose or take any action
based on this message or any information herein. If you have received
this message in error, please contact the sender and delete this
message. Thank you.

El 17/02/2012, a las 17:18, Daniel Hanke
reply@reply.github.com
escribió:

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'


Reply to this email directly or view it on GitHub:
#87 (comment)

@ctilley83

This comment has been minimized.

Show comment
Hide comment
@ctilley83

ctilley83 Feb 17, 2012

I had tried that But it did not work for me

I had tried that But it did not work for me

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 20, 2012

Hay, author!! When will be normal fix for that?? Please, give it for us! >_<

Hay, author!! When will be normal fix for that?? Please, give it for us! >_<

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 21, 2012

@fjyaniez: i mounted it my putting this line into routes.rv:
mount Ckeditor::Engine => '/ckeditor'
then rake assets:precompile again.

i did not even mention the ck* files in the precompile-paths.

after precompiling, domain.tld/assets/[ckeditor/?]ckeditor.js was available

To be more accurate, this solution works for me in production only, not in development, which is ok in my place.

@fjyaniez: i mounted it my putting this line into routes.rv:
mount Ckeditor::Engine => '/ckeditor'
then rake assets:precompile again.

i did not even mention the ck* files in the precompile-paths.

after precompiling, domain.tld/assets/[ckeditor/?]ckeditor.js was available

To be more accurate, this solution works for me in production only, not in development, which is ok in my place.

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

@Inbreed:

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'

As I can see this is setted by default, isn't?

@Inbreed:

did anyone of you mount the ckeditor to routes.rb? since then i was able to precomile and everything was awesome ;)

mount Ckeditor::Engine => '/ckeditor'

As I can see this is setted by default, isn't?

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 21, 2012

iirc you have to call a rake-task for installation, or was that on old version only?

i defenately can remember some rake ckeditor:install stuff.

iirc you have to call a rake-task for installation, or was that on old version only?

i defenately can remember some rake ckeditor:install stuff.

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

yeap rake ckeditor:install. It create some models, smth else and add that line into routes.rb

yeap rake ckeditor:install. It create some models, smth else and add that line into routes.rb

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 21, 2012

so since it was missing for him, i thought he might have forgotten ;)

so since it was missing for him, i thought he might have forgotten ;)

@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 21, 2012

@Inbreed I have configured it exactly as you, but no luck for me on production. So weird...(I ran generators and follow gem installation instructions word by word).

@Inbreed I have configured it exactly as you, but no luck for me on production. So weird...(I ran generators and follow gem installation instructions word by word).

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 21, 2012

@fjyaniez Did you also try Pepans hint? If its still not working you could download ckeditor and unpack to public/assets/ckeditor, rerun assets:precompile as workaround. thats the only think i can share with you - until its fixed, if its a bug. hopefully nobody slaps me for this hackaround ;)

@fjyaniez Did you also try Pepans hint? If its still not working you could download ckeditor and unpack to public/assets/ckeditor, rerun assets:precompile as workaround. thats the only think i can share with you - until its fixed, if its a bug. hopefully nobody slaps me for this hackaround ;)

@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 21, 2012

@Inbreed I put the ckeditor gem's version to public/javascripts and use include_javascript_tag. It's a workaround.

@Inbreed I put the ckeditor gem's version to public/javascripts and use include_javascript_tag. It's a workaround.

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

@flyaniez what are you included with include_javascript_tag? Can give piece of code?

@flyaniez what are you included with include_javascript_tag? Can give piece of code?

@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 21, 2012

Sure @graffzon

  <%= javascript_include_tag '/javascripts/ckeditor/ckeditor' %>
$ ls public/javascripts/ckeditor 
CHANGES.html  LICENSE.html  ckeditor.js    ckeditor_basic.js         ckeditor_source.js  contents.css  images  plugins  themes
INSTALL.html  adapters      ckeditor.pack  ckeditor_basic_source.js  config.js           filebrowser   lang    skins

I extracted the ckeditor folder from the gem instead downloading from ckeditor's homepage because the gem's one is modified to work with paperclip.

Sure @graffzon

  <%= javascript_include_tag '/javascripts/ckeditor/ckeditor' %>
$ ls public/javascripts/ckeditor 
CHANGES.html  LICENSE.html  ckeditor.js    ckeditor_basic.js         ckeditor_source.js  contents.css  images  plugins  themes
INSTALL.html  adapters      ckeditor.pack  ckeditor_basic_source.js  config.js           filebrowser   lang    skins

I extracted the ckeditor folder from the gem instead downloading from ckeditor's homepage because the gem's one is modified to work with paperclip.

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

what gem version are you using?

what gem version are you using?

@fjyaniez

This comment has been minimized.

Show comment
Hide comment
@fjyaniez

fjyaniez Feb 21, 2012

ckeditor (3.7.0.rc2)

ckeditor (3.7.0.rc2)

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

Strange, but it doesn't work for me. Curly hands =(

Strange, but it doesn't work for me. Curly hands =(

@graffzon

This comment has been minimized.

Show comment
Hide comment
@graffzon

graffzon Feb 21, 2012

I copied into assets/ckeditor. Work's fine, will wait normal fix.

I copied into assets/ckeditor. Work's fine, will wait normal fix.

@thedanielhanke

This comment has been minimized.

Show comment
Hide comment
@thedanielhanke

thedanielhanke Feb 21, 2012

keep in mind after you copied, you should at least regenerate config.js if you want to use the assets.
if it fails:

CKEDITOR.editorConfig=function(a){a.filebrowserBrowseUrl="/ckeditor/attachment_files",a.filebrowserFlashBrowseUrl="/ckeditor/attachment_files",a.filebrowserFlashUploadUrl="/ckeditor/attachment_files",a.filebrowserImageBrowseLinkUrl="/ckeditor/pictures",a.filebrowserImageBrowseUrl="/ckeditor/pictures",a.filebrowserImageUploadUrl="/ckeditor/pictures",a.filebrowserUploadUrl="/ckeditor/attachment_files",a.filebrowserParams=function(){var a=jQuery("meta[name=csrf-token]").attr("content"),b=jQuery("meta[name=csrf-param]").attr("content"),c=new Object;return b!==undefined&&a!==undefined&&(c[b]=a),c},a.extraPlugins="embed,attachment",a.toolbar="Easy",a.toolbar_Easy=[["Source","-","Preview"],["Cut","Copy","Paste","PasteText","PasteFromWord"],["Undo","Redo","-","SelectAll","RemoveFormat"],["Styles","Format"],["Subscript","Superscript","TextColor"],["Maximize","-","About"],"/",["Bold","Italic","Underline","Strike"],["NumberedList","BulletedList","-","Outdent","Indent","Blockquote"],["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],["Link","Unlink","Anchor"],["Image","Attachment","Flash","Embed"],["Table","HorizontalRule","Smiley","SpecialChar","PageBreak"]]};

keep in mind after you copied, you should at least regenerate config.js if you want to use the assets.
if it fails:

CKEDITOR.editorConfig=function(a){a.filebrowserBrowseUrl="/ckeditor/attachment_files",a.filebrowserFlashBrowseUrl="/ckeditor/attachment_files",a.filebrowserFlashUploadUrl="/ckeditor/attachment_files",a.filebrowserImageBrowseLinkUrl="/ckeditor/pictures",a.filebrowserImageBrowseUrl="/ckeditor/pictures",a.filebrowserImageUploadUrl="/ckeditor/pictures",a.filebrowserUploadUrl="/ckeditor/attachment_files",a.filebrowserParams=function(){var a=jQuery("meta[name=csrf-token]").attr("content"),b=jQuery("meta[name=csrf-param]").attr("content"),c=new Object;return b!==undefined&&a!==undefined&&(c[b]=a),c},a.extraPlugins="embed,attachment",a.toolbar="Easy",a.toolbar_Easy=[["Source","-","Preview"],["Cut","Copy","Paste","PasteText","PasteFromWord"],["Undo","Redo","-","SelectAll","RemoveFormat"],["Styles","Format"],["Subscript","Superscript","TextColor"],["Maximize","-","About"],"/",["Bold","Italic","Underline","Strike"],["NumberedList","BulletedList","-","Outdent","Indent","Blockquote"],["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],["Link","Unlink","Anchor"],["Image","Attachment","Flash","Embed"],["Table","HorizontalRule","Smiley","SpecialChar","PageBreak"]]};

@mokagio

This comment has been minimized.

Show comment
Hide comment
@mokagio

mokagio Feb 21, 2012

The "put it in the public and don't care about the assets pipeline" workaround works for me too. But is so sad to have to use it instead of the gem :(

mokagio commented Feb 21, 2012

The "put it in the public and don't care about the assets pipeline" workaround works for me too. But is so sad to have to use it instead of the gem :(

@ctilley83

This comment has been minimized.

Show comment
Hide comment
@ctilley83

ctilley83 Mar 2, 2012

rc3 fixed the problem.

rc3 fixed the problem.

@ctilley83 ctilley83 closed this Mar 2, 2012

@prikha

This comment has been minimized.

Show comment
Hide comment
@prikha

prikha Jun 13, 2012

I'm using 3.7.1 and still have the same problem, i have those files precompiled but
still no luck it complains of not havind them. I had to do so

  config.serve_static_assets = true
  config.assets.compile = true

prikha commented Jun 13, 2012

I'm using 3.7.1 and still have the same problem, i have those files precompiled but
still no luck it complains of not havind them. I had to do so

  config.serve_static_assets = true
  config.assets.compile = true
@joneslee85

This comment has been minimized.

Show comment
Hide comment
@joneslee85

joneslee85 Jun 19, 2012

Same here, I had no luck, I ended up manually copy the ckeditor to public/assets

Same here, I had no luck, I ended up manually copy the ckeditor to public/assets

@crazymykl

This comment has been minimized.

Show comment
Hide comment
@crazymykl

crazymykl Jun 27, 2012

This is still broken.

This is still broken.

@daniALGA

This comment has been minimized.

Show comment
Hide comment
@daniALGA

daniALGA Jul 1, 2012

This is still broken. +1

daniALGA commented Jul 1, 2012

This is still broken. +1

@LeviRosol

This comment has been minimized.

Show comment
Hide comment
@LeviRosol

LeviRosol Aug 15, 2012

still an issue.

still an issue.

@prasvin

This comment has been minimized.

Show comment
Hide comment

prasvin commented Sep 4, 2012

+1

@galetahub

This comment has been minimized.

Show comment
Hide comment
@galetahub

galetahub Sep 4, 2012

Owner

Try this:
Edit config/environments/production.rb:

config.assets.precompile += Ckeditor.assets
Owner

galetahub commented Sep 4, 2012

Try this:
Edit config/environments/production.rb:

config.assets.precompile += Ckeditor.assets
@brodock

This comment has been minimized.

Show comment
Hide comment
@brodock

brodock Sep 11, 2012

@galetahub sorry but it doesn't work, here is the output I'm getting:

/Users/brodock/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/brodock/.rvm/gems/ruby-1.9.3-p194@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Invalid CSS after "*": expected "{", was "html .cke_uicol..."

"html" may only be used at the beginning of a selector.
  (in /Users/brodock/.rvm/gems/ruby-1.9.3-p194@capitulo/gems/ckeditor-3.7.1/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/brodock/.rvm/rubies/ruby-1.9.3-p194...]

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

brodock commented Sep 11, 2012

@galetahub sorry but it doesn't work, here is the output I'm getting:

/Users/brodock/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/brodock/.rvm/gems/ruby-1.9.3-p194@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Invalid CSS after "*": expected "{", was "html .cke_uicol..."

"html" may only be used at the beginning of a selector.
  (in /Users/brodock/.rvm/gems/ruby-1.9.3-p194@capitulo/gems/ckeditor-3.7.1/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/brodock/.rvm/rubies/ruby-1.9.3-p194...]

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
@brodock

This comment has been minimized.

Show comment
Hide comment
@brodock

brodock Sep 11, 2012

My fault, I've updated to latest version (3.7.3) and it's fixed now... I see that 0504705 fixed the problem.

Thanks.

brodock commented Sep 11, 2012

My fault, I've updated to latest version (3.7.3) and it's fixed now... I see that 0504705 fixed the problem.

Thanks.

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