How to remove JS error in ruby on rails 7? - ruby-on-rails

I am learning ruby on rails and i am trying to add custom JS in my application, but after sometime i removed all the files related to custom JS. But rails still gives me that kind of error, Why?
Can anyone tell me how to remove this because of this my working functionality doesn't work anymore. Thanks in advance.
Here is error:
Uncaught TypeError: Failed to resolve module specifier "custom/customJS". Relative references must start with either "/", "./", or "../".

Related

Why is Facebook Pixel suddenly raising "Can't find variable: Set" in specs

Testing a Rails app with rspec & poltergeist, my tests have suddenly started raising
Facebook Pixel Error: ReferenceError: Can't find variable: Set
at http://connect.facebook.net/en_US/fbevents.js:24 in fc
There is a FB pixel embedded in the page, but I cannot figure out what is causing this error. I am unable to recreate it in a browser. I have been unable to track down the reference to Set variable in fbevents.js or anywhere else.
Has anyone experienced this, or knows how to resolve?
It's likely because the version of PhantomJS that you're using doesn't support JavaScript ES6.

Rails App Suddenly Not Working

I was just working on one of my models when my Rails app would not work anymore. Even typing out commands like rails -v, rails, c, bundle install, or any command is giving out the same error. What's causing it is a syntax error on the file fileutils.rb. I'm using the ruby version ruby-1.9.3-p551.
First set of error messages.
(I have not included the middle part of the error messages.)
Last set of error messages.
I do not understand as to what caused the file fileutils.rb to be modified or be syntax errored.
I have modified the fileutils.rb by copy-pasting lines 309-421 from another fileutils.rb file.
I got it working again but I am still confused as to what corrupted my file.

Converting Rails 4 App to Engine changes i18n locale namespacing causing I18n::MissingTranslationData errors

Converted my Pfoodler app to an engine. The Pfoodler engine is mounted in a test app. So far so good. Rails server launches and test app loads.
When I start the Pfoodler engine, it throws an error:
translation missing: en.pfoodler.static_pages.home.page_title
As a sidebar, in the app version, the i18n string is searched for and located as
en.static_pages.home.page_title
Converting the app to an engine has added the engine namespace to the i18n file search params. This has broken all the locale YAMLs, and there are dozens of files. I could fix the error by adding the pfoodler namespace to every file, but that seems like the wrong way to solve this problem.
I get the feeling there is a very simple solution, but I have not found it. What is the best way to solve this problem?
Thanks for your help.

Rails ckeditor Invalid CSS after "*": expected "{", was "html .cke_uicol..."

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

Missing template exception_notifier/exception_notification.erb

The following error occurs when an exception is generated. I am using vendor/rails-2.3.10 and ruby 1.8.7
Missing template exception_notifier/exception_notification.erb in view path app/views
Thanks in advance
The error is telling you that the app is trying to load app/views/exception_notifier/exception_notification.html.erb and can't find it.
The easy (and wrong) solution is to create that file, and maybe put some HTML in it, though possibly an empty file will do.
The correct solution is to look at the documentation for the exception_notifier plugin you appear to have installed, and figure out why it's looking for that view, and either put something relevant there (the plugin probably has an example) or disable rendering of that view when an exception occurs.

Resources