How to delete a cached file template in Intellij - ruby

I'm trying to work on a Ruby project in Intellij. I tried creating a new file using the Ruby Class Template file type. However, for some reason when I open the file it opens the file with the application that is associated with the .rb extension in my OS config, instead of opening it in Intellij.
EDIT:
Although I still have the issue described below I figured it was worth mentioning that I was able to get Ruby Class Template types working by creating a new empty Ruby project first then importing
my Ruby project as a new module in the Project Settings. See Importing a
module and configuring a separate SDK for it ~
source
END OF EDIT
I figured out that if I just create a file using the basic File type in Intellij and name it with the .rb extension then I can open it in Intellij.
So after I figured this out I tried deleting the original file I created with the Ruby Class Template type. This time I created it as a plain File type and gave it the .rb extension. But, Intellij still doesn't associate this as a Ruby file (it still has a ? mark symbol next to the file). I tried creating multiple variations of *.rb file names and they all work, which confirms the issue is only with this one particular file name.
So I can only think that Intellij has some cached reference of the file name and it's template file type.
I tried searching by %project_name% and deleting any results under
source SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.<PRODUCT><VERSION>
But that didn't work. I also renamed the cache folder and restarted Intellij, to no avail.
Aside from a complete reinstall does anyone have any advice on if I'm going in the right direction, and if so, where I might find this hidden cache reference?

For those not able to access the link to the solution posted as a comment by #y.bedrov
The provided solution was to check the following
In Settings(Preferences) | Editor | File Types check all the
registered patterns for Files Opened in Associated Applications:
As I accessed this screen and scrolled to the bottom I found my file. I removed the file from the list and now my issue is solved. I can now create this file and have it open in Intellij!

Related

visual studio keeps adding a _1 to a project name crashing the build

I created a project, lets say named AddonLib, which is part of a big solution. For some unknown reason, the folder where the source code was put was named AddonLib_1. I've been trying to get rid of that "_1" for too long now and is driving me crazy. Things I've tried:
removed the project, from TFS and the solution. Renamed the directory. When I try to add the project again, I get the message "The project file "blabla\AddonLib_1\AddonLib.vcxproj" has been moved, renamed or is not on your computer".
Edited the xml file of the solution. Check the project file just to be sure. Removed any trace of the project with and without _1. The project AddonLib is no longer part of the solution. Try to add it back again, same error as before.
Cleared the VS cache following the instructions here. Repeated previous step. Same error.
I cannot find any reference to AddonLib_1 on my code, xml files, anything. But everytime I try to load the project, I get the same error.
Looking for the string "AddonLib_1" using findstr gives no results...
This causes the build to break. Even if there are no references (that I can find) to AddonLib_1, when building in the server I get an error "project AddonLib_1/AddonLib.vcxproj could not be found blablabla"....
Besides the solution xml file, the project xml file, the xml files of the few projects that depend on this project, where else can the information that once the project was in the directory AddonLib_1 ?
More info:
I can remove the project. Remove it from TFS, from the solution, and delete the directory. Create a new project with the desired name. Add the source and header files. Now, I need to add some info to the project xml file. If I open the xml file and edit, when I try to load back the project (Which was loaded before!) I get the same error message. If I open the xml again, undo the minor change I did, I still get the error. Again, this is in a new project, starting from zero.
I was able to solve this issue by removing the .suo file as described in this apparently unrelated answer

Could not copy the file "..\HiQPdf.dep" because it was not found

I get this build error after trying to use HTML to PDF Converter Library for .NET. I copy over the dll, dep and xml files from the ZIPped folder downloaded from the website but when I compile my code, the HiQPdf.dep disappears.
The FAQs from the website say to change the execute permissions of the HiQPdf.dep file but after i do this, it still doesn't work.
How can i get rid of this error?
I resolved this by changing the execute permissions on the HiQPdf.dep file and then changing it to read-only. I don't see how this is a stable or logical fix but it is working now.
I solved this issue by just removing & re-adding the dll.

Modifying ClickOnce Output Folder Hierarchy

I'm attempting to publish a ClickOnce Office Extension project (VS2010). By default the output folder of ClickOnce has a child folder (with each version of the binary files) named "Application Files." I need to change this to something without a space in the name, for example "AppFiles."
I haven't found any place in the docs where this is explained and the few answers I have found have said to use Mage to manually modify .VSTO file next to the bootstrap setup.exe. I'd like to avoid that if at all possible.
What is the best way to go about changing this?
I have tried a few different things. Instead of using the built in Microsoft.Common.props, In a copy of Microsoft.Common.targets I've modified the _DeploymentApplicationFolderName property inside the _CopyFilesToPublishFolder target to "Application_Files." Also in a copy of Microsoft.VisualStudio.Tools.Office.targets, I've modified the Value of the ApplicationFilesFolderName property set inside InitializePublishProperties to "Application_Files."
Even after doing that, when I publish I get the following error:
Error 121 Publish failed with the following error: Could not find a part of the path '<path to output directory>\app.publish\Application Files\ProjectStats_1_0_0_15'.
I'm guessing the problem is this is happening when the copy from the output dir to the publish dir happens but I don't know. Either way, the output directory hierarchy seems fine and the VSTO refers to the proper path in the hierarchy for the relevant dlls. It's just the publish process fails.
It turns out there's no way to fix this and still use the Publish wizard in Visual Studio. After looking at the code for the Publish method in Microsoft.VisualStudio.Tools.Applications.Project.ClickOnceProvider.BuildManager class in the Microsoft.VisualStudio.Tools.Applications.Project.dll assembly, the directory name "Application Files" is hard coded. There is no way to automatically fix this from what I can tell.

Accessing an external file from MacRuby

I have done several small scripting/automation projects before but this is my first time using MacRuby and I couldn't find out at all why my project is not working.
This task would have been easy to fix if it was just a plain Ruby script. However, it needs a Mac GUI so I decided to use MacRuby for its Cocoa bindings.
The app itself is a simple form that will perform a calculation based from some data from an external CSV and some text fields and then show the results of the calculation.
My problem is that this code does NOT seem to work:
#arr_from_csv = CSV.read("data.csv")
Upon building the file, I get the following error:
[...]/ruby/1.9.2/CSV.rb:1335:in `open': No such file or directory - open() failed (Errno::ENOENT)
At first, I thought that I must have put the CSV file into the wrong directory inside XCode project's folder structure. I tried putting on the same folder as the script itself (app_delegate.rb). Didn't work. I tried putting it in the Resources folder, still didn't work.
Then, I decided to just use an absolute file path. So, I changed to code into:
#arr_from_csv = CSV.read("~/data.csv")
and copied the file into my home directory. It still can't read the CSV file.
Am I missing something? I'm sorry, this is my first time using MacRuby.
Thanks.
You should change the code to "/Users/xxx/data.csv".
Ruby does not expand "~" to "/Users/xxx".
Notice: xxx represents your login id.
I was able to solve my problem by using:
#arr_from_csv = CSV.read(File.expand_path("~/data.csv"))

VS2010 not embedding files into assembly

For some reason in VS2010 I can't embed any file into an assembly. These files have their Build Action property set to Embedded Resource as they should, but when the assembly is executed it founds no resources. For example, the following test code:
string[] list = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
string msg = (list.Length > 0) ? "Full" : "Empty";
MessageBox.Show(msg);
always shows "Empty" because GetManifestResourceNames() always returns an empty list.
This issue affects a project using nettiers in which is not convenient for that particular case to include the stored procedures into the DB, so they must be taken from the Procedures.xml file, which BTW is automatically set with Build Action= Embedded Resource after the classes generation, and then of course when a function tries to get any SQL script from it, the program fails.
I also created a couple of test projects where I tried to embed an xml and a gif, always with no success.
Update: The problem seems to be only for C#. I reproduced the test project in VB.Net and there the file does get embedded. I've noticed that in the output window, in the C# case, the compiler command line doesn't include the /resource option (which should be there followed with the name of the file to embed) whereas for the VB case it does appear.
Are there any global settings or configuration files anywhere for C# I should check? (The build options for the project have nothing strange there)
Does anyone have an idea of what may be happening and how to fix this?
Finally, I found the cause:
There was a wrong line inside the Microsoft.CSharp.targets file (located inside c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319). There was a tag written as:
<EmbeddedResourceF Include="#(_Temporary)" />
instead of
<EmbeddedResource Include="#(_Temporary)" />
Writing it right restored the ability to embed files
How that F appeared and why that file got altered in first place, I dont know... Despite being a .NET programmer for several years I just became aware today of the ".targets" files after searching the web about this issue, as never have had the need to look about the MSBuild stuff.

Resources