Is there a reliable Command Line or Powershell step format to run RSpec tests on TeamCity? - ruby

We are experimenting with using RSPec for our UI tests and noted that while attempting to integrate these with TeamCity we end up with environment related errors. The problem is that when we run these tests locally on the build server they run without any errors.
We are trying to execute the login test within a working directory located on the build server with a Command Line or Powershell:
cd D:\web_smoke_tests-master
gem install bundler
rake cloud:chrome
We are returning the following error in our build log despite the environment containing all of the ruby dependencies. Note that this is a windows build server / build agent.
[21:31:30]Step 3/5: Execute login test (Command Line)
[21:31:30][Step 3/5] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script #edited out
[21:31:30][Step 3/5] in directory: D:\web_smoke_tests-master
[21:31:30][Step 3/5] 'gem' is not recognized as an internal or external command,
[21:31:30][Step 3/5] operable program or batch file.
[21:31:30][Step 3/5] 'rake' is not recognized as an internal or external command,
[21:31:30][Step 3/5] operable program or batch file.
[21:31:30][Step 3/5] Process exited with code 1
[21:31:30][Step 3/5] Step Execute login test (Command Line) failed

Regarding the above. This was due to the user containing the build agent not having any ruby dependencies installed and as a result "gem" or "rake" were not recognized.

Related

Unable to install python version for a virtual environment, ERROR conda.core.link:_execute(733)

# Been stuck on this for a day and a half, am very new to python and am trying to create a virtual >environment with python=3.6 anaconda
everything downloads and I run into the >following error:
>Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
ERROR conda.core.link:_execute(733): An error >occurred while installing package 'defaults::qt->5.9.7-vc14h73c81de_0'.
Rolling back transaction: ...working... done
LinkError: post-link script failed for package >defaults::qt-5.9.7-vc14h73c81de_0
location of failed script: >C:\Anaconda\envs\PythonData\Scripts.qt-post->link.bat
==> script messages <==
>
==> script output <==
stdout: 1 file(s) copied.
stderr: 'chcp' is not recognized as an internal >or external command,
operable program or batch file.
'chcp' is not recognized as an internal or >external command,
operable program or batch file.
'chcp' is not recognized as an internal or >external command,
operable program or batch file.
return code: 1
()
Any ideas would be greatly appreciated, online
>searches return minimal results.

Cannot install Watir on Jruby 9.1.12.0 - Windows 7

I am trying to install gems from a local gem repository into Jruby 9.1.12.0 and I am getting stuck on Watir which is pretty much the first one I tried.
I am running on Windows 7 with JDK 1.8.0_131
I get the following:
Error installing watir:
ERROR: Failed to build gem native extension
it looks as though the rest of the error message is complaining about ffi-1.9.18 I am afraid I can't post the exact error message as it is inside a VM that is not internet enabled.
update: full error message:
C:\Ruby\gem>jruby -S gem install watir
Building native extensions. This could take a while...
C:/jruby-9.1.12.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:58: warning: Tempfile#unlink or delete called on open file
; ignoring
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/ffi-1.9.18/ext/ffi_c
C:/jruby-9.1.12.0/bin/jruby.exe -r ./siteconf20170718-2540-6mqxiv.rb extconf.rb
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/ffi-1.9.18/ext/ffi_c
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/ffi-1.9.18/ext/ffi_c
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.
make failed, exit code 1
Gem files will remain installed in C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/ffi-1.9.18 for inspection.
Results logged to C:/jruby-9.1.12.0/lib/ruby/gems/shared/extensions/universal- java-1.8/2.3.0/ffi-1.9.18/gem_make.out
I got this working now. It was obvious from the error message that 'Make' was not being located correctly. I added the correct directory to the path and Watir was installed correctly.

HDInsight Installation failure

I am trying to install Microsoft HDInsight Emulator for Windows Azure using the Web Platform Installer 5.0. The installation fails while installing Hortonworks Data Platform. The following are the part of logs after installation:
CAQuietExec: Checking JAVA_HOME is set correctly...
CAQuietExec: 'C:\Azul\zulu1.7.0_65-7.6.0.1-win64\bin\java -version 2>&1 | findstr /i "version"' is not recognized as an internal or external command,
CAQuietExec: operable program or batch file.
CAQuietExec: "1.6.0_31" was unexpected at this time.
CAQuietExec: Error 0x800700ff: Command line returned an error.
CAQuietExec: Error 0x800700ff: CAQuietExec Failed
CustomAction CheckPreReq returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
I have checked that JAVA_HOME is set in environment variables to C:\Azul\zulu1.7.0_65-7.6.0.1-win64. When I run the command 'C:\Azul\zulu1.7.0_65-7.6.0.1-win64\bin\java -version 2>&1 | findstr /i "version"' in command prompt, It returns the result with the version 1.7.0_65.
I don't understand why in the log this command is not recognized while I am able to execute it and from where 1.6.0_31 version came in log?
Could you please help me to resolve this problem?
Thanks in advance.
I found the cause of the failure. It was that command was wrapped in single quotes by installer and command prompt was not recognising it. After replacing single quotes with double quotes I am not getting this error.

Windows 8, gulp calling clear

I'm using laravel elixir for running phpunit and less compilations,
but when it's running it want's to call 'clear' but that throws the error
{ [Error: Command failed: 'clear' is not recognized as an internal or external command, operable program or batch file.
this is probably due the fact that windows doesn't know the command clear but uses cls so how can I fix that gulp uses cls?
Output
grt
Had the same issue !!! my bad , copied some stuff from the internet ...
there was a gulp.js file on the root of my project...
look for a line :
.pipe(run('clear'))
I just comment the clear out and replace with cls
Hope it works...

Error executing Ruby in Jenkins

I'm running Jenkins ver. 1.537 on Win7 64.
I'm trying to run a Ruby script in Jenkins using the "Execute Ruby script" build function.
The command is C:/autotest/Ultrapos_FX2-3/lib/testout.rb.
The script I'm trying to run is a simple hello world type thing:-
begin
puts 'TEST OUTPUT'
end
I can run this sucessfully from the command prompt, but Jenkins gives me the following error:-
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\jobs\ruby\workspace
[workspace] $ ruby -v C:\Users\ithomp\AppData\Local\Temp\hudson8549990801552818192.rb
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
C:/Users/ithomp/AppData/Local/Temp/hudson8549990801552818192.rb:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
C:/autotest/Ultrapos_FX2-3/lib/testout.rb
^
Build step 'Execute Ruby script' marked build as failure
Finished: FAILURE
It seems that Jenkins is not executing the script that I'm specifing and instead calling some temp file.
Any ideas as to what the issue is?.
Thanks.
Ian.

Resources