Unable to automate Travis from command line

Hi, I’m trying to automate some travis/github stuff in Julia. I’m running into some problems.

When I try to run travis login from the command line it works just fine, but if I try to run from within julia, I run into problems.

julia> run(`travis login`)
ERROR: could not spawn `travis login`: no such file or directory (ENOENT)
 in _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:321
 in #414 at .\process.jl:478 [inlined]
 in setup_stdio(::Base.##414#415{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
 in #spawn#413(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\process.jl:477
 in run(::Cmd) at .\process.jl:591

From your command line check where travis is installed:
$ which travis

Check if that folder appears on PATH env from julia

julia> ENV["PATH"]

1 Like

What is travis here, and how did you install it?

Yes, the path, C:\Ruby22-x64\bin, is in both which travis and ENV["PATH"]

travis is the command line interface for travis. I got it with gem install travis, where gem is Ruby’s package manager.

Might be windows related… Does it happen only with travis command line tool? Does julia> run(dir) work for you?

Yes, julia> run(dir) works fine

Try running it from a windows Cmd prompt first. Julia will behave mostly like that on Windows.

:frowning: should I file an issue?

travis is a ruby script.
Does this work for you?

julia> run(`ruby --version`)
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

Yes, it works just fine

Have you tried:

run(`cmd /c travis login`)
1 Like

Worked like a charm! How did you figure that out?