0

I'm experienced with Ruby but new to PHP, getting CakePHP set up on my machine and I would love some help.

I've downloaded a version of Cake and placed it at /Users/zack/Sites/cake

From that directory, I've done cd cake/console and tried running cake bake but get the error env: node: No such file or directory

I've tried running chmod 755 cake to change permissions but that didn't work.

Any suggestions on how to get this working properly?

Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151

1 Answers1

1

This is a pretty strange issue :))

1) You've installed coffeescript and it comes with a cake command. It's in /usr/bin so if there's no local cake available then it will run;

2) CakePHP's cake command only works if you are in an app folder (so cd myCakeApp first);

3) coffeescript's cake is a NodeJS script. It tries running node something. The error you are getting is telling you it could not find NodeJS.

Try prepending ./, so ./cake bake. That will make sure it only tries to run the cake command inside the current path/folder.

Sergiu Paraschiv
  • 9,929
  • 5
  • 36
  • 47
  • So I re-installed Node, running `cake bake` in my `cake` directory now gives me `/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:111 throw new Error("Cakefile not found in " + (process.cwd())); ^ Error: Cakefile not found in /Users/zackshapiro/Sites/cake/cake/config` – Zack Shapiro Mar 30 '15 at 21:34
  • But why would you need NodeJS and coffeescript? Now you made coffeescript's `cake` run, not CakePHP's `cake`. Do you understand that those are two totally different "applications" and you are running the wrong one? It's a naming collision. A coincidence. – Sergiu Paraschiv Mar 30 '15 at 21:36
  • I understand that now. Thanks :) You're right, node and coffeescript have nothing to do with cake. Sucks they're named the same things. Going into the app folder for `cake` and running `cake bake` is now giving me coffeescript related errors, so now I'm even more confused – Zack Shapiro Mar 30 '15 at 21:41
  • 1
    Try prepending `./`, so `./cake bake`. That will make sure it only tries to run the `cake` command inside the current path/folder. – Sergiu Paraschiv Mar 30 '15 at 21:43