Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed: psych Could not be configured. It will not be installed. #386

Open
KB1RD opened this issue Feb 6, 2024 · 3 comments
Open

Comments

@KB1RD
Copy link

KB1RD commented Feb 6, 2024

Using instructions from https://asdf-vm.com/guide/getting-started.html. Then, I ran asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby. Finally, I ran asdf install ruby latest, which failed as seen below:

==> Downloading ruby-3.3.0.tar.gz...
-> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.0M  100 21.0M    0     0  19.9M      0  0:00:01  0:00:01 --:--:-- 19.9M
==> Installing ruby-3.3.0...
-> ./configure "--prefix=$HOME/.asdf/installs/ruby/3.3.0" --enable-shared --with-ext=openssl,psych,+
-> make -j 8
*** Following extensions are not compiled:
psych:
	Could not be configured. It will not be installed.
	Check /tmp/ruby-build.20240205150155.58895.3MNQVx/ruby-3.3.0/ext/psych/mkmf.log for more details.

BUILD FAILED (Ubuntu 20.04 on x86_64 using ruby-build 20240119)

You can inspect the build directory at /tmp/ruby-build.20240205150155.58895.3MNQVx
See the full build log at /tmp/ruby-build.20240205150155.58895.log

Logs from psych configure:

pkg_config: checking for pkg-config for yaml-0.1... -------------------- not found

LD_LIBRARY_PATH=.:../.. pkg-config --exists yaml-0.1
package configuration for yaml-0.1 is not found
--------------------

find_header: checking for yaml.h... -------------------- no

LD_LIBRARY_PATH=.:../.. "gcc -o conftest -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/psych    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wmisleading-indentation -Wundef  -fPIC conftest.c  -L. -L../.. -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -Wl,-rpath,/home/kb1rd/.asdf/installs/ruby/3.3.0/lib -L/home/kb1rd/.asdf/installs/ruby/3.3.0/lib -lruby-static -lz -lrt -lrt -lgmp -ldl -lcrypt -lm -lpthread   -lm -lpthread  -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

LD_LIBRARY_PATH=.:../.. "gcc -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/psych    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wmisleading-indentation -Wundef  -fPIC   -c conftest.c"
conftest.c:3:10: fatal error: yaml.h: No such file or directory
    3 | #include <yaml.h>
      |          ^~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <yaml.h>
/* end */

--------------------

Workaround is to install libyaml-dev on Ubuntu.

The provided error message should either be more descriptive (since I had to dig through log files to find this), or there should be something in the documentation.

@top-sigrid
Copy link

For the record, I got the same error on MacOS Sonoma and installing libyaml via brew install libyaml also solved the issue.

@Rffrench
Copy link

Rffrench commented May 7, 2024

If anyone is trying to install Ruby on Ubuntu 22.x, just don't install version 3.31.

@andergtk
Copy link

These are the libs I had to install to make asdf install ruby latest work:

sudo apt-get install libz-dev libssl-dev libffi-dev libyaml-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants