gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
209 stars 34 forks source link

Install issue: Could not find library file for YAML #24

Closed curtis628 closed 6 years ago

curtis628 commented 6 years ago

I'm getting install errors when trying to install lyaml via luarocks on both OSX and Photon OS (Linux).

$ sudo luarocks-5.1 install lyaml 6.2
Installing https://luarocks.org/lyaml-6.2-1.src.rock...
Using https://luarocks.org/lyaml-6.2-1.src.rock... switching to 'build' mode

Error: Could not find library file for YAML
  No file libyaml.a in /usr/local/lib
  No file libyaml.dylib in /usr/local/lib
  No file matching libyaml.so.* in /usr/local/lib
  No file libyaml.a in /usr/lib
  No file libyaml.dylib in /usr/lib
  No file matching libyaml.so.* in /usr/lib
You may have to install YAML in your system and/or pass YAML_DIR or YAML_LIBDIR to the luarocks command.
Example: luarocks install lyaml YAML_DIR=/usr/local

Any idea what I'm missing? Here are the lua and luarocks versions I'm using:

15:13 $ lua-5.1 -v
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
✔ ~/.kube 
15:13 $ luarocks-5.1 | head -2

LuaRocks 2.3.0, a module deployment system for Lua

NOTE: On my attempts to get this working with Photon OS (which is my primary goal), I'm using LuaJIT 2.1.0-beta2

curtis628 commented 6 years ago

NOTE: I get the same error when I try to install 6.1.3 too

gvvaughan commented 6 years ago

do you have libyaml.so and the yaml header files (libyaml-dev or similar depending on your distro) installed?

if so, are they on the linker search path? some older Linux releases might need you to call luarocks with eg YAML_LIBDIR=/usr/lib/linux-unknown-x86_64

curtis628 commented 6 years ago

Thanks for the tip, @gvvaughan .

I got this working on PhotonOS by first installing libyaml-devel and gcc. Then I could install lyaml via luarocks:

tdnf -y install libyaml-devel gcc
luarocks install lyaml

I got this working on OSX by doing something similar

brew install libyaml
sudo luarocks-5.1 install lyaml

I'm good to go now.