Rails ckeditor Invalid CSS after "*": expected "{", was "html .cke_uicol..." - ruby-on-rails

I'm updating an app to rails 3.1 and I'm getting this error when precompiling my assets, I've updated ckeditor to 4.0.2 because according to this Github Issue that will fix it but the error is still there. Do I have to do something after I update the gem?
Here's the full error:
Invalid CSS after "*": expected "{", was "html .cke_uicol..."
"html" may only be used at the beginning of a compound selector.
(in /home/stanwinston/stanwinston/app/assets/javascripts/ckeditor/_source/plugins/uicolor/yui/assets/yui.css)
Thank you in advanced!

Well, I am going to catch some flak for this but, after trying to upgrade and blah blah blah 3 hours, here was how I fixed it:
Due to the complexity of my app, and the requirement to support IE 8, I was unable to readily change the rails or ckeditor version. What I did instead was to fix the css included in the gem:
/opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/ckeditor-3.7.1/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css
There is a "*html" where you need a "* html", note the space.
Here are some related posts about the issue:
http://dev.ckeditor.com/ticket/9411 and https://github.com/galetahub/ckeditor/issues/188
Then I precompiled my assets locally, so that the asset compilation happened on my machine with the patched gem. I am not a fan of this method, but my client is not a fan of broken web forms, or longer hours spent updating libraries without adding any new features.
There is no point in submitting a pull request against the gem, since it is code from a 3rd party of a 3rd party and the gem has long since switched to rails 4 support.
Feel free to tell me I am wrong for X reason below.

I'm also stumble upon the same situation but update my Rails version to 3.2+ solve the problem

Related

How to fix the warning: "DEPRECATION: action_cable.js has been renamed to actioncable.js – please update your reference before Rails 8"? (Rails 7.0.4)

I have a Ruby on Rails single page application using React as the front-end, and since we upgraded from Rails 6.1 to Rails 7.0, the warning "DEPRECATION: action_cable.js has been renamed to actioncable.js – please update your reference before Rails 8" appears on the browser console in almost every page of the application, except for static views (without forms or such) such as e-mails and the home page.Warning on the browser console
I've tried reviewing my Gemfile to make sure they are up-to-date, ran bundle update hoping that the problem was caused by an outdated gem, but the warning is still there. I've checked the project folder, and there is no "action_cable.js" or "actioncable.js" file, nor are there any references to those files/paths in any part of the code.
Does anybody have an idea on how to fix this warning? I couldn't find any information on how to do it, or other people that are having the same issue.
This is my first time posting here, so if there's any information missing, I'll be more than happy to share it!

Rails 4.2 + Ember => unexpected identifier

I'm following Vic Ramon's tutorial. I tried to use the latest version of Rails and Ember-source and I get the following error when visiting home page:
After clicking on link next to error I get this:
How can I fix that?
I ran the following commands:
rails g ember:bootstrap -n App --javascript-engine coffee
rails g ember:install
I removed turbolinks. I also created home controller and an empty view for home#index. Root is set to home#index. Also created following view file:
// app/assets/javascripts/templates/application.js.emblem
h1 Hello World
outlet
Ember gems im using:
Using emblem-source 0.3.18
Using ember-data-source 1.0.0.beta.14.1
Using ember-rails 0.16.1
Using emblem-rails 0.2.2
This could be due to some version incompatibilities between your versions of ember-related gems, as there were quite substantial changes in recent versions of ember (e.g. introduction of HTMLBars, etc.)
Your best bet is to clone the original repo and then try to upgrade individual gems and check if it still works after each upgrade. This way you will be able to identify the troubling gem.
I have verified that the original repo code indeed works with the versions of gems in its current Gemfile.lock.
If you are starting a new Rails + Ember app, ember-cli-rails is probably the way to go, giving you the best of both worlds.
Emblem was the culprit. Replacing .emblem with .handlebars fixed the problem. I tried the tip from emblem-rails git page and icluded
gem "emblem-source", github: "machty/emblem.js"
but that didn't change anything.
I also followed this tutorial (alongside a few others) and I encountered several issues alongside the way ranging from handling templates to setting up the JSON API. I don't see your entire source code so I cannot pinpoint the exact problem. However, it seems that we have similar projects, so you can compare your code to my blog project source code and see what is causing these issues. Comparing to Ramon's tutorial, my blog has implemented everything until chapter 15.
https://github.com/Deovandski/Fakktion/tree/Ember-Rails
If you are a beginner like myself, then I recommend avoiding CoffeeScript and Emblem and sticking to Javascript as much as possible for the first months because you will find more resources and examples. Also, let me know if you need assistance in setting up the project as I used .gitignore to hide things like secrets.yml

Rails 4 asset pipeline throws "only generation of JSON objects or arrays allowed"

This may be related to JSON error with coffeescript & Rails asset pipeline
I'm working on an app in Rails 4. I have an asset called tasks.js.coffee. Until recently everything was fine. This morning I wanted to make a change, and Rails throws "only generation of JSON objects or arrays allowed".
It seems that any change is sufficient to throw the error, even removing a blank line, or changing a single character in a string. When I revert changes it works again.
I'm assuming some gems got updated yesterday when I did a bundle update, causing this problem.
Did anybody else see it? Does anyone know what causes this problem, and how to fix it?
I had to set the execjs version in the Gemfile to 1.4.0: gem 'execjs' '1.4.0'. The recent update to 2.0.0 seems to be the one causing the issue.
Update your ruby version to 2.0.0.

Sexy Forms in Rails

I stumbled across a page describing a plugin - semantic_form_builder (the blog entry was titled "sexy forms"). The plugin was written by Glenn Gillen, with rubypond. Anyhow, when I tried to install the plugin, I got some messages indicating that some of the rake tasks were "deprecated", so I'm guessing the issue is due to the fact I'm using Rails 3 & this was written for an earlier version. Anyone know if this has been updated, converted into a gem or something along those lines?

Turn on html_safe for the entire app in Rails 3

Rails 3 turns off the html_safe option by default. I want to revert this thing. I have a rails 2.3.8 app getting converted to rails 3. Almost every page breaks because of the rails3 default html_safe setting. Is there any way I can revert this to where it was in previous versions of rails ? Please help
No, there isn't and even if there is, you shouldn't.
It's a good habit to test (and update) your app using the rails_xss plugin in Rails 2.3.x before actually starting the conversion to Rails 3.
Also, you should have a valid test suite in place so that every error will be spotted by the test suite and you can easily fix it.
Don't try to upgrade unless you have completed these two simple steps. There are also a few other suggestions.
As a side note: Current versions of Rails 3 HTML-escape also non-HTML templates, which is a bug. See: https://rails.lighthouseapp.com/projects/8994/tickets/4858
I'm posting this here, because I found this question while investigating the bug mentioned above, but didn't fine that ticket or anything about this bug on the interwebs. (Bad google skills?) Hope it saves someone time.

Resources