Open apierz opened 4 years ago
@apierz apologies, herb is definitely hard to find. We should probably release it a little more visibly.
From a clone of the urbit repo, and with Nix installed, use:
nix-env -f default.nix -iA herb
to install it.
/cc @philipcmonk
I was able to clone the urbit repo, install nix, and run nix-env command you gave me. That created a herb bin. I symlinked it to /usr/local/bin/herb (I had to edit the path in hoon-mode.el as at somepoint MacOS decided to deny me access to /usr/bin). When I try the eval buffer command I get this:
Traceback (most recent call last):
File "/usr/local/bin/herb", line 11, in <module>
import requests
ImportError: No module named requests
I have requests installed for both Python 2 and 3 using pip. I get Requirement already satisfied if I try to install them.
Hmm. If you just run the herb symlink with --help
in your shell, does that work ok?
The reason that requests
is not being found here is that Nix manages dependencies itself, so it's using its own Python toolchain, etc., and can't see whatever's installed via pip.
cc @eglaysher @liam-fitzgerald or someone who actually uses emacs, is there anything special that you needed to do here?
And herb is getting launched without said nix dependencies in the PYTHONPATH or similar?
On Wed, Aug 19, 2020 at 08:10, Jared Tobin notifications@github.com wrote:
Hmm. If you just run the herb symlink with --help in your shell, does that work ok?
The reason that requests is not being found here is that Nix manages dependencies itself, so it's using its own Python toolchain, etc., and can't see whatever's installed via pip.
cc @eglaysher https://github.com/eglaysher @liam-fitzgerald https://github.com/liam-fitzgerald or someone who actually uses emacs, is there anything special that you needed to do here?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/urbit/hoon-mode.el/issues/19#issuecomment-676485806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOFPBWNKNJWLOQDIOJFED3SBPTNLANCNFSM4QDX6G4A .
I get the same error trying to run herb from the terminal. When I copied the herb.py to /usr/local/bin I got it to run. After messing with it for a little bit I got this to work on the command line:
➤ herb --dojo '(add 2 2)' ~/urbit-v0.10.8-darwin/zod
4
When I try the eval command in emacs I get this error:
WARNING <module> 416 - No pier or port specified, looking on port 12321
WARNING <module> 447 - unrecognized response
<html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1><p>There was an error while handling the request for "/".</p><code>/app/lens/hoon:<[36 3].[61 64]><br />/app/lens/hoon:<[35 3].[61 64]><br />/app/lens/hoon:<[33 3].[61 64]><br />/app/lens/hoon:<[32 3].[61 64]><br /></code></body></html>
Which is similar to what I got when I was messing around with herb on the command line and malformed a command. Is there something else I need to put in the .hoon file for it to eval properly? How would I use the eval command to test input?
@baudtack Can you advise on this one by any chance? This Vim user (i.e. me) is in the wrong neighbourhood.
It looks to me like herb changed and hoon-mode.el hasn't been updated. It's a pretty clunky interface that just like builds a string of what you're trying to do and then asks the shell to evaluate it. I've ended up not really using this feature as outside of small chunks of self contained code, it's not actually useful. I'm not sure when I'll have the time to update it but someone else can have a go at it. It should be relatively straightforward.
I am trying to get the commands to work to eval regions and buffers but it requires herb and I can't figure out what that is. I have tried searching on homebrew and emacs package lists and found nothing. There's something called herb on npm but I don't know how to turn what I installed that into a binary that emacs could find and then run.
Any advice you could give would be much appreciated.