ZachMassia / PlatformIO-Mode

PlatformIO Integration for Emacs
GNU General Public License v3.0
67 stars 20 forks source link

Wrong type argument: stringp, nil #12

Closed ivan-avalos closed 5 years ago

ivan-avalos commented 5 years ago

I have the mode enabled, but when I try to run the command inside the platfomio.ini buffer, the following error appears (I have the debug mode enabled):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  locate-file-internal(nil ("./") nil #f(compiled-function (f) #<bytecode 0x400a65e5>))
  locate-file(nil ("./") nil #f(compiled-function (f) #<bytecode 0x400a65e5>))
  cd(nil)
  compilation-start("platformio -f -c emacs run " platformio-compilation-mode)
  platformio--exec("run ")
  platformio--run(nil nil)
  platformio-build(nil)
  funcall-interactively(platformio-build nil)
  call-interactively(platformio-build record nil)
  command-execute(platformio-build record)
  execute-extended-command(nil "platformio-build" "platformio-build")
  funcall-interactively(execute-extended-command nil "platformio-build" "platformio-build")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
ZachMassia commented 5 years ago

Hi Ivan,

When you have your file open, do you see Projectile[*ProjectRootFolderName*] in the mode-line?

It's possible you may just need a quick git init in the project root to have Projectile pick it up.

ivan-avalos commented 5 years ago

I did the git init but now I have a different problem. Whenever I try to perform a build or something, it fails with the following message:

-*- mode: platformio-compilation; default-directory: "~/Desktop/mongoose-demo/demo-empty/" -*-
PIOCompilation started at Mon Mar  4 19:41:22

platformio -f -c emacs run 
/bin/bash: platformio: command not found

PIOCompilation exited abnormally with code 127 at Mon Mar  4 19:41:22

That happens despite I actually have platformio installed. I don't know why Emacs can't find it. Thanks.

ZachMassia commented 5 years ago

Are you using pyenv by chance?

ivan-avalos commented 5 years ago

How do I check that? I don't think I have it enabled.

ZachMassia commented 5 years ago

It's a version manager for Python. Chances are you don't have it then.

Which OS are you on? Most likely a path issue then.

ivan-avalos commented 5 years ago

I'm using the Cocoa version of Emacs on macOS. Do you think that's the problem?

ZachMassia commented 5 years ago

I'm also on a Mac, with a Homebrew installed Emacs.

I'll link you the relevant section in my config I used to fix the issue.

So long as you can open the default terminal and run which platformio and get an output, you should be all set once you get your full PATH imported into Emacs.

ZachMassia commented 5 years ago

https://github.com/ZachMassia/.emacs.d/blob/master/emacs.org#misc

ivan-avalos commented 5 years ago

I'm also on a Mac, with a Homebrew installed Emacs.

I'll link you the relevant section in my config I used to fix the issue.

So long as you can open the default terminal and run which platformio and get an output, you should be all set once you get your full PATH imported into Emacs.

That's exactly what I did right now, it worked! Now there's another error, but that's related with PlatformIO rather than with platformio-mode.

Error: Please setup environments in `platformio.ini` file

Thanks!

ZachMassia commented 5 years ago

No problem! Sounds like you're on track now.👍