Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Im trying to build Qpid . When running CMake this is printed to the log:

Could NOT find Ruby  (missing:  RUBY_LIBRARY)
[ ... more stuff cut for brevity ]
CMake Error at src/CMakeLists.txt:96 (include):
  include could not find load file:
    C:/qpid/0.6/qpid/build/src/rubygen.cmake

It seems to be failing because it couldnt find a file thats supposed to have been generated. But it hasn't since it couldn't locate Ruby.

But it seems to at least partially find Ruby since a bunch of other RUBY_* variables have been set in CMake like RUBY_EXECUTABLE and RUBY_INCLUDE_DIR.

What is RUBY_LIBRARY and what is it supposed to be set to? Ruby is installed in C:\Ruby192.

According to /usr/share/cmake-2.8/Modules/FindRuby.cmake:

#  RUBY_LIBRARY      = full path to the ruby library

I see you're on Windows. I would guess that to link against the DLL, you'd either point at ${RUBY_DIR}\lib\msvcrt-ruby191.lib or ${RUBY_DIR}\bin\msvcrt-ruby191.dll (I'm using the names from a Ruby 1.9.1 binary I grabbed from ruby-lang.org). To link against the static library, you'll want ${RUBY_DIR}\lib\msvcrt-ruby-191-static.lib.

I have no idea if the fact that these libraries are built against msvcrt will cause problems when linking with the VS2008 compiler. I gave that hairball away long ago.

Typically, library variables in CMake should be set to the full path to the library file used by the linker... For dlls, it's the corresponding .lib import library file. In this case, "${RUBY_DIR}/lib/msvcrt-ruby191.lib" – DLRdave Feb 25, 2011 at 23:21 I know this is an old discussion but I'm running into the same "missing RUBY_LIBRARY" problem trying to build WebKit on Windows. Curiously, the library files installed in c:\Ruby193\lib are named libmsvcrt-ruby191.dll.a and libmsvcrt-ruby191-static.a. Those are incorrect (Unix) names for Windows library files. How do I fix that? Follow-up question: RUBY_LIBRARY can be set as an environment variable, correct? – Phil Jul 3, 2014 at 21:37 @Phil RUBY_LIBRARY is CMake variable. You can set it with -DRUBY_LIBRARY= parameter when running cmake. CMake variables are (in general) different from environment variables. Setting these manually is an desperate act of last result. Builds are supposed to autodetect those. – user7610 Apr 11, 2020 at 14:23

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.