sublime text ruby test windows cannot find path - ruby-on-rails

I am running Windows 7 and have installed the sublime text ruby test. I can run rspec spec/
fine from the command line, however when I try it from sublime text i get the following error:
I check the PATH variable and its the same in my command line.
--
The system cannot find the path specified.
[Finished in 0.1s with exit code 1]
[cmd: ['bundle exec rspec spec\\models\\user_spec.rb']]
[dir: C:\Users\User1\Sites\sample_app]
[path: C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\site\bin;C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\bin;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.0.0\bin]

On Windows, instead of
"cmd": ["cake", "sbuild"]
it should be
"cmd": ["cake.cmd", "sbuild"]
Instead of modifying it just add:
"windows":
{
"cmd": ["cake.cmd", "sbuild"]
}

My guess is that you are using Sublime Text 3. I had the same problem and solved it as follows.
The cmd is passed as an array, while it should be a string. Maybe this worked in Sublime Text 2, but not in Sublime Text 3.
A solution that fixes the problem for me (Win 7, Sublime Text 3) is editing the code in run_ruby_test.py in the RubyTest folder.
Line 202: change this:
"cmd": [command],
to
"cmd": command,
Hope it helps!

Related

MSBuild Windows Kits 10 error with objidl.idl

Trying to build my solution with MSBuild 15.0 from TFS2017 server, I have the following errors:
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl (702, 0)
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl(702,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Interface 'IStorage' ) ]
and
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl (742, 0)
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl(742,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Parameter 'snbExclude' ) ]
I have tried different versions of \include, \lib, \bin folders such as:
10.0.17134.0
10.0.16299.0
10.0.10586.0
10.0.10240.0
to no avail.
Any ideas or help how to resolve this issue are highly appreciated!
Thanks
First please make sure your local environment is as same as your build agent/server environment.
Besides, also take a look at this similar question, which maybe helpful to you:
error MIDL2072: inapplicable attribute : [annotation] [ Type 'SNB' ( Interface 'IStorage' )
Give a try with the solution mentioned in the link:
Remove all references on older SDK's binary directories in 'Executable
Directories' for 'VC++ Directories' in Properties for
'Microsoft.Cpp.x64.user'; otherwise the wrong (previous) version of
the MIDL compiler (that doesn't understand newer SAL/MIDL syntax) will
run with possible errors.

Sublimetext3 Building with Lua (windows)

I'm having difficulty building using lua in sublimetext3, this is how set up my system: using a sublimetext3 lua environment and build system on a *.lua file. I keep receiving this error:
[WinError 2] The system cannot find the file specified
[cmd: ['lua', 'C:\\Users\\Joe\\Documents\\SublimeText3\\LuaWorkspace\\helloworld.lua']]
[dir: C:\Users\Joe\Documents\SublimeText3\LuaWorkspace]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\Joe\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\mingw-w64\i686-7.3.0-posix-dwarf-rt_v5-rev0\mingw32\bin;C:\Program Files\Git\cmd;C:\Program Files\LOVE;C:\Progra~1\Lua\5.3.4_64;C:\Users\Joe\AppData\Local\Microsoft\WindowsApps;]
[Finished]
and this is what my lua.sublime_build file looks like:
{
"cmd": ["lua", "$file"],
"file_regex": "^(?:lua:)?[\t ](...*?):([0-9]*):?([0-9]*)",
"selector": "source.lua"
}
I can get this to work fine using a cmd prompt with lua *.lua however it would be nice to do it straight from sublime.
I've solved the issue after some digging and researching... the problem was how lua was being found; my fix was to place a .bat file within the path folder that helps find the lua53 command:
Innards of the .bat file:
#"%~dp0lua53.exe" %*
Changes to the lua.sublime_build file:
"cmd": ["lua.bat", "$file"]
all other lines can remain the same.

xcopy /s /y "$(SolutionDir)packages\Apache.Ignite.1.6.0\Libs\*.*" "$(TargetDir)Libs" error while building in jenkins

Hello All,
while building Visual project project from jenkins am getting below error i have set msbuild plugin and set path in jenkins.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command " [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: if not exist "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" md "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*" "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs"" exited with code 4. [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
Done Building Project "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default target) (1) ->
(ResolveAssemblyReferences target) ->
According to the error log:
error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*"
You can find $(SolutionDir) is Undefined.
That because you may build the a single project (NOT Solution) in jenkins. In this case, MSBuild running each project independently not the Solution, so MSBuild could not find the define for $(SolutionDir). It worked fine in Visual Studio, but not on the build server.
To resolve this issue, you can use $(ProjectDir)..\ instead of $(SolutionDir)
So the command line should be:
if not exist "$(TargetDir)Libs" md "$(TargetDir)Libs"
xcopy /s /y "$(ProjectDir)..\packages\Apache.Ignite.2.2.0\Libs\*.*" "$(TargetDir)Libs"
But, I found the command line in the error log is not same as in the title, so you may need to double check the command line.
Hope this helps.

MSBuild Warning MSB3884 when building from command line

When building our solution on the build server (using Jenkins) with MSBuild 14 following warning occurs:
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.CurrentVersion.targets(133,9):
warning MSB3884: ruleset file "ManagedMinimumRules.ruleset" could not
be found.
Executing the same command line call on my dev machine, this warning won't appear.
Any ideas why this warning appears on the build server?
I've already opened an issue for MSBuild: https://github.com/Microsoft/msbuild/issues/361
Solution: Create an empty rule set file and pass that as a command line parameter to MSBuild.
NoRules.ruleset file:
<?xml version="1.0" encoding="utf-8"?>
<!--
Problem: warning MSB3884
Visual Studio 2015 includes references to MinimumRecommendedRules.ruleset in .csproj files.
MSBuild 10 cannot find this reference and generates warning MSB3884.
Solution: Create NoRules.ruleset [this file] and pass it to MSBuild in a command switch. Need to pass full path name to MSBuild.
Example: MSBuild /property:CodeAnalysisRuleSet="$Workspace\NoRules.ruleset"
References:
https://msdn.microsoft.com/en-us/library/dd264949.aspx
https://msdn.microsoft.com/en-us/library/ms164311.aspx
-->
<RuleSet Name="NoRules" Description="This rule set contains no rules." ToolsVersion="14.0">
</RuleSet>
For a Jenkins build, add the following MSBuild switch to override the project settings and use the NoRules file:
/property:CodeAnalysisRuleSet="$Workspace\NoRules.ruleset"
You can just add the NoRules file to source control. I chose to build it on the fly in Jenkins with a Batch file prior to the MSBuild step:
set NoRules=NoRules.ruleset
#echo Making %NoRules%
if not exist %NoRules% (
#echo ^<?xml version="1.0" encoding="utf-8"?^> >%NoRules%
#echo ^<!-- >>%NoRules%
call :WriteToFile %NoRules% "Problem: warning MSB3884"
call :WriteToFile %NoRules% " Visual Studio 2015 includes references to MinimumRecommendedRules.ruleset in .csproj files."
call :WriteToFile %NoRules% " MSBuild 10 cannot find this reference and generates warning MSB3884."
#echo. >>%NoRules%
call :WriteToFile %NoRules% "Solution: Create NoRules.ruleset [this file] and pass it to MSBuild in a command switch."
call :WriteToFile %NoRules% " Need to pass full path name to MSBuild."
#echo Example: MSBuild /property:CodeAnalysisRuleSet="$WORKSPACE\NoRules.ruleset" >>%NoRules%
#echo. >>%NoRules%
call :WriteToFile %NoRules% "References:"
call :WriteToFile %NoRules% " https://msdn.microsoft.com/en-us/library/dd264949.aspx"
call :WriteToFile %NoRules% " https://msdn.microsoft.com/en-us/library/ms164311.aspx"
#echo --^> >>%NoRules%
#echo ^<RuleSet Name="NoRules" Description="This rule set contains no rules." ToolsVersion="14.0"^> >>%NoRules%
#echo ^</RuleSet^> >>%NoRules%
)
exit /b %errorlevel%
:WriteToFile
#echo %~2 >>%1
exit /b %errorlevel%
This file also shows the comments in the Jenkins ConsoleOut display. This should help you know what why you did this later.
related: VS2015: warning MSB3884: Could not find rule set file
Check your csproj has a DevEnvDir and not a path to VS (esp vs2010). I reckon your laptop's got the appropriate VS installed and your build server doesn't.
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
Create the following folder on your build server:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
Copy all of your ruleset files from your dev machine onto the build server.
Then add the following registry key by creating a "addkey.reg" file with the following contents:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\EDev]
"StanDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Team Tools\\Static Analysis Tools\\"
Run it on your build server, reboot, done, warning gone.
Add this property to the msbuild command:
CodeAnalysisRuleSetDirectories="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Static Analysis Tools\Rule Sets".
For example, I used this command
>"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild" solutionName.sln /target:build /property:Configuration=Release;CodeAnalysisRuleSetDirectories="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Static Analysis Tools\Rule Sets"

Sublime Text 2 - build can't find something on my path?

I have the following coffeescript build file:
{
"cmd": ["coffee", "-c", "$file"]
, "selector": "source.coffee"
}
which when I try to run it gives me:
[Error 2] The system cannot find the file specified [cmd: [u'coffee',u'-c', u'W:\mayapp\myscript.coffee']]
[dir: W:\myapp]
[path: /usr/local/bin:C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Microsoft\Web Platform Installer\;C:\Program Files
(x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files
(x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program
Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files
(x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft
SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL
Server\110\Tools\Binn\ManagementStudio\;c:\Program Files
(x86)\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\TortoiseHg\;C:\Program Files
(x86)\nodejs\;C:\Program Files\Mercurial\;C:\Program
Files\TortoiseSVN\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program
Files (x86)\Bitvise SSH
Client;C:\Chocolatey\bin;C:\Users\George\AppData\Roaming\npm\;C:\Program
Files\Gallio\bin;C:\Program Files (x86)\Git\cmd;] [Finished]
In powershell
coffee -c w:\myapp\myscript.coffee
runs just fine leading me to think it's the coffee file from npm that the build system cannot find. Yet notice the npm directory IS on my path and coffee.cmd is absolutely in that directory
W:> get-command coffee | select path
Path
----
C:\Users\George\AppData\Roaming\npm\coffee.cmd
my best guess is that the error is due to that linux path prefixed to sublime's path variable but I have no idea where that is coming from it is not in my path variable outside of sublime.
The solution was to use the command name with extension - sublime was unable to infer it.
So:
{
"cmd": ["coffee.cmd", "-c", "$file"]
, "selector": "source.coffee"
}

Resources