Skip to content
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

Works in Dev not in Production Rails 3.2 #87

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

Works in Dev not in Production Rails 3.2 #87

ctilley83 opened this issue Feb 8, 2012 · 36 comments

Comments

@ctilley83
Copy link

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
Copy link

factore commented Feb 9, 2012

+1

@factore
Copy link

factore commented Feb 10, 2012

Looks like there's a temporary workaround at #84

@mokagio
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@thedanielhanke
Copy link

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
Copy link

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
Copy link
Author

I had tried that But it did not work for me

@graffzon
Copy link

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

@thedanielhanke
Copy link

@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
Copy link

@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
Copy link

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
Copy link

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

@thedanielhanke
Copy link

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

@fjyaniez
Copy link

@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
Copy link

@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
Copy link

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

@graffzon
Copy link

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

@fjyaniez
Copy link

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
Copy link

what gem version are you using?

@fjyaniez
Copy link

ckeditor (3.7.0.rc2)

@graffzon
Copy link

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

@graffzon
Copy link

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

@thedanielhanke
Copy link

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
Copy link

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
Copy link
Author

rc3 fixed the problem.

@prikha
Copy link

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

@runlevel5
Copy link

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

@crazymykl
Copy link

This is still broken.

@daniALGA
Copy link

daniALGA commented Jul 1, 2012

This is still broken. +1

@LeviRosol
Copy link

still an issue.

@prasvin
Copy link

prasvin commented Sep 4, 2012

+1

@galetahub
Copy link
Owner

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

config.assets.precompile += Ckeditor.assets

@brodock
Copy link

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests