How to clear Sprockets cache? - sprockets

When a Sprockets object compilation fails (due to a syntax error in CoffeeScript or SASS), it cannot recompile after the error is fixed because it says "file is already required."
In order to get the Sprockets object to work, I have to destroy and re-create it. I was wondering if anyone knew if there was a way to tell the Sprocket object to internally reset itself as to not run into this issue.

rake tmp:cache:clear deletes the temporary cache directory.

In my case, the following command worked:
rake tmp:clear

It should be:
Rails.application.assets.cache.clear
but this method only in master branch and not even in beta.
Update: added in 4.0.0.beta5.

Related

Drools 6.5: java.lang.RuntimeException: Illegal class for global. Expected [com.user.PersonAccount], found [com.user.PersonAccount]

I'm using the "org.springframework.boot:spring-boot-devtools" dependency in my Grails application for the live reload of the application on code change. The problem is, it seems that this dependency is causing some conflict with drools.
On kieSession.setGlobal(name, value) in my code, I get the following error:
java.lang.RuntimeException: Illegal class for global. Expected [com.user.PersonAccount], found [com.user.PersonAccount]
Removing the "spring-boot-devtools" dependency fixes the issue but I need this dependency for the live reload, it's important in development.
Anyone knows why this dependency is causing this conflict? and what I can do to fix it or as a workaround?
Thanks in advance!
To whoever might have the same issue in future, the issue is already reported and described before: https://issues.redhat.com/browse/DROOLS-1540 and a fix has been included in drools starting from version 7.26.0.Final (https://github.com/kiegroup/drools/commit/85c5308031a84a0ac4086c1df363bb1b4b3c6af9)
If you don't want to upgrade to the latest version of drools, there's still a workaround to fix the issue which is already mentioned on the devtools page of spring-boot (https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools.restart.customizing-the-classload).
I added META-INF/spring-devtools.properties with the jars that I want to include in the restart classloader (mainly the drools + kie jars) & the issue is fixed.
When the devtools recompile the class, the byte code no longer matches the byte code from your rules. It's not doing a very good job of warning you, but what it's trying to say is "you are trying to give me a com.user.PersonAccount instance, but it doesn't look like what I know a com.user.PersonAccount instance should look like."
Therefore if you insist on using this tool which will recompile things on the fly, you'll need to also recompile and reload the rules on the fly. Or not use spring-boot-devtools.

Cannot start the application. TypeError: Cannot read property 'definition' of undefined at getFieldsJsonSchemaFor

I'm getting an extremely weird error when trying to npm start my loopback application. I literally did nothing to the code and then this all of a sudden started to happen
Cannot start the application. TypeError: Cannot read property
'definition' of undefined
at getFieldsJsonSchemaFor (/Users/vikramkhemlani/Desktop/loopback/node_modules/#loopback/repository-json-schema/dist/filter-json-schema.js:101:64)
I have the same exact code in another file (which i actually created a git repo from using this repo) but this one is throwing this error for some reason
I went through the same issue.
Apparently there are caches which need to clean up before starting the application. (Expired caches also appear in openapi before I get into this issue)
The project needs to be clean and re-install packages by following:
npm run clean
npm install
I have the same problem.
However, I solved it when I tried the following.
delete node_modules directory.
npm install.
Hello from the LoopBack team 👋
This may be a bug in LoopBack introduced by recent changes. Please create a small application reproducing the problem (see our Bug reporting instructions) and open a new GitHub issue in https://github.com/strongloop/loopback-next/issues/new

apostrophe cms version 2.65.0 giving error on running project

I am upgrading the apostrophe version from 2.62.0 to 2.65.0. While upgrading I have added the mongo driver-3 into setting also still running the project, I am getting the error :
(node:116248) Warning: a promise was created in a handler at project/node_modules/async/lib/async.js:167:37 but was not returned from it, see xxxx
Thanks for the help in advance!
This is only a warning. bluebird thinks we might be unintentionally ending a promise chain, but it is intentional and nothing is wrong. It was addressed in Apostrophe 2.68.0 according to bluebird's instructions for silencing it where appropriate, so update to the latest with npm update and it will stop.

Capistrano -- the task `staging:symlink' does not exist

I'm attempting to deploy to a server via Capistrano and I keep getting the error the task `staging:symlink' does not exist.
I've run cap:deploy setup and cap deploy successfully getting the releases and shared directories created but the above error always shows at the end and I think it's stopping my code from getting moved to the root of the directory where it belongs.
I'm new at using Capistrano and I've Googled the issue but I cannot find anything that helps. I can include my code and everything I just don't know what to show to help... let me know!
Thanks for any help you can provide!
The built-in symlink task for capistrano 2.x is cap deploy:symlink.
staging:symlink is not a valid task, unless you've defined it yourself. If you're not defining this, you are accidentally calling it somewhere in your config files (deploy.rb or one of your staging config files, if you're using multistage).
Additionally, deploy:symlink should be called automatically as part of the deploy task. You don't need to call it manually.

build failed executing nant

I've got a nant build script (.86 beta) and it is telling me this:
BUILD FAILED
Failed to initialize the 'Microsoft
.Net Framework 2.0' target
framework.
The process cannot access the file
'C:\Users\cconway\AppData\Local\Temp\tmp25E3.tmp'
because it is being used by another
process.
This file does not even exist on my machine. Does anyone know the cause of this? Rebooting seems to allow me to run the script once successfully, but every time after that I get this message (though the name of the tmp file changes per reboot).
Thanks!
Are there any third-party tasks which might leave temp files open or keep running in the background, thus leaving file locked?
Maybe try sysinternals process monitor which will allow you to see the process which has the handle on this file.
Also, make sure that you have all the right versions of .Net installed and they are the correct ones (SDK vs Runtime). If you open the config file for nant you can see where it expects the .net version to be go check to make sure it's there and that you can see hte compiler methods (csc, vbc, etc). So it could have something that is trying to find it but it's not there or the pathing is off.
It is beta so there could even be a typo in the config file.
The answer is my anti-virus. I should have tried disabling that first! Once I disabled it, everything worked like a charm.
Hope this helps someone.