#2096 Installed Fantom using brew on OSX: build fails

KPNC Thu 7 Feb 2013

I've installed Fantom using brew on OSX. Then I followed the Fantom pods tutorial

The build failed:

$ fan build.fan 
compile [hello]
  Compile [hello]
    FindSourceFiles [1 files]
    WritePod [file:/usr/local/Cellar/fantom/1.0.64/libexec/lib/fan/hello.pod]
sys::IOErr: java.io.FileNotFoundException: /usr/local/Cellar/fantom/1.0.64/libexec/lib/fan/hello.pod (Permission denied)
  java.io.FileOutputStream.open (FileOutputStream.java)
  java.io.FileOutputStream.<init> (FileOutputStream.java:212)
  fan.sys.LocalFile.out (LocalFile.java:433)
  fan.sys.File.out (File.java:365)
  compiler::WritePod.write (WritePod.fan:54)
  compiler::GenerateOutput.run (GenerateOutput.fan:46)
  compiler::Compiler.backend (Compiler.fan:115)
  compiler::Compiler.compile (Compiler.fan:67)
  build::BuildPod.compileFan (BuildPod.fan:222)
  build::BuildPod.compile (BuildPod.fan:157)
  java.lang.reflect.Method.invoke (Method.java:601)
  fan.sys.Method.invoke (Method.java:559)
  fan.sys.Method$MethodFunc.callOn (Method.java:230)
  fan.sys.Method.callOn (Method.java:139)
  build::TargetMethod.run (TargetMethod.fan:77)
  build::BuildScript.main (BuildScript.fan:316)
  fan.sys.List.each (List.java:555)
  build::BuildScript.main (BuildScript.fan:316)
  java.lang.reflect.Method.invoke (Method.java:601)
  fan.sys.Method.invoke (Method.java:559)
  8 More...
/usr/local/Cellar/fantom/1.0.64/libexec/lib/fan/hello.pod: Cannot write
BUILD FAILED [31ms]!

The reason is that brew was installed as root.

I tried to add outPodDir=`lib` in the build.fan script. The build passed, an empty lib directory appeared along with a hello.pod in the project directory. But there is no way to use it, because it is not properly installed.

Is there a way to specify an alternate directory for the pods?

andy Thu 7 Feb 2013

You need to create a new PathEnv.

The easiest way todo that is create an empty file called fan.props in the directory you wish to create the working path.

KPNC Thu 7 Feb 2013

Thanks!

Login or Signup to reply.