Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Decaf.cmd not found #5

Closed
behappyrightnow opened this issue Aug 7, 2014 · 12 comments
Closed

Error: Decaf.cmd not found #5

behappyrightnow opened this issue Aug 7, 2014 · 12 comments

Comments

@behappyrightnow
Copy link

Followed the README instructions, installed Decaf, but am getting this error when trying to run the fixture:
Unable to start test system 'slim': java.io.IOException: Cannot run program "decaf.cmd": error=2, No such file or directory

Any ideas?

@anderslm
Copy link

anderslm commented Oct 8, 2014

You installed the package with -g enabled?
npm install -g decaf

Which user are FitNesse running under and for which user have you installed decaf?

What operating system are you using?

@msuarz
Copy link
Member

msuarz commented Oct 8, 2014

Hey sorry for the delay ... yes I install it with -g ... I use windows mainly ... I have a couple of macs so I could try there

@anderslm
Copy link

anderslm commented Oct 8, 2014

Could you check that decaf is installed in %AppData%\npm? Also, which user did you install as and which user do you run FitNesse as? They have to match.

@davidmoshal
Copy link

I have exactly the same issue:

"Unable to start test system 'slim': java.io.IOException: Cannot run program "decaf.cmd": error=2, No such file or directory"

I ran decaf, to see if it was installed, and got an error:

"env: coffee\r: No such file or directory"

So, apart from user issues, it's not finding coffee.

I installed as sudo, and ran FitNesse as me, a user on OSX with admin privileges.

I'm actually wondering if we can install this locally somewhere so that it can be run by the same user that runs fitnesse.

Any idea about the environment error?

@davidmoshal
Copy link

Couple of things of note:

  1. I'm on OSX and the error in the test browser is:
    start test system 'slim': java.io.IOException: Cannot run program "decaf.cmd": error=2, No such file or directory

Note "decaf.cmd" - I'm on OSX, but that looks like a Windows command, no?

  1. my decaf is installed as an alias in
    /usr/bin
    decaf aliases:
    ../lib/node_modules/decaf/bin/decaf

@davidmoshal
Copy link

Ok, so a tiny bit of progress:

After this instruction:

Point your browser to http://localhost:8080/root?edit

you need to change
{decaf.cmd %p}
to
{decaf %p}
ie:

!define TEST_SYSTEM {slim}
!define COMMAND_PATTERN {decaf.cmd %p}
!path fixtures!path fixtures

So, now it runs decaf, shows this for 10 seconds:

Preparing Tests...

Then there is a red warning:

Error Occurred

and a yellow warning:

Testing was interrupted and results are incomplete. 
Test Pages: 0 right, 0 wrong, 0 ignored, 0 exceptions     
Assertions: 0 right, 0 wrong, 0 ignored, 0 exceptions (10.102 seconds)

and, it throws this exception from the jar file:

WARNING: error registered in test system [null]
java.lang.NullPointerException
    at fitnesse.testsystems.slim.SlimCommandRunningClient.writeString(SlimCommandRunningClient.java:209)
    at fitnesse.testsystems.slim.SlimCommandRunningClient.invokeAndGetResponse(SlimCommandRunningClient.java:135)

So, now we're actually running decaf, but I'm still concerned about this message which you get when running decaf from the command line:

env: coffee\r: No such file or directory

That's my next exploration.

David

@davidmoshal
Copy link

So, in googling around I came across folks who had a similar error, with a different program:

surjikal/sublime-coffee-compile#9

The advice is:

OSX mountain lion doesn't use the environment variables you set in your .bash_profile (or equivalent) when you launch GUI apps. But there's a way to give GUI apps env variables. You do this by creating/modifying your /etc/launchctl.conf file.

Add the following line to /etc/launchctl.conf:

setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:<node_dir>:<coffee_dir>

And then reboot.

@NicoleRauch
Copy link

I ran into the same problem on Mac OS X... Neither bin/decaf nor bin/decaf-js work for me on the command line. And I don't really feel like tampering around with launchctl.conf (also b/c of portability).

So my ugly and brute-force but sufficient solution is this:

!define TEST_SYSTEM {slim}
!define COMMAND_PATTERN {node ../node_modules/decaf/lib/decaf %p}

(given that the folder where I invoke Fitnesse is a sibling of the node_modules folder)

@msuarz: Maybe you can find a nicer way to get this to work on a Mac?

@msuarz
Copy link
Member

msuarz commented Dec 29, 2014

I just switched my dev setup into mac ... I'll look into it ... cheers

@msuarz
Copy link
Member

msuarz commented Dec 31, 2014

It looks like a problem with line endings ... i was able to run everything fine in the mac ... I republished and the new version should have the proper line endings given i did it from the mac ... I think windows can handle it fine ... plus the error was in a line that windows doesn't care for ... please notice that as david said it works with {decaf %p} instead of decaf.cmd

cheers ... happy new year

@NicoleRauch
Copy link

The new version 0.1.6 now works for me - thanks very much!

Happy New Year :-)

@msuarz
Copy link
Member

msuarz commented Jan 2, 2015

awesome cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants