If you want to know the options when configuring Ruby, see `RbConfig :: CONFIG ["configure_args "]`


--If you want to know the option when configuring cruby, see RbConfig :: CONFIG ["configure_args "].


$ uname -mrv
4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64
$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

$ rbenv --version
rbenv 1.1.2-34-g0843745
$ ruby -v
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]

Main subject

I was told if I used dpkg-shlibdeps with the binary I put in rbenv.

$ pwd
$ mkdir debian;touch debian/control
$ dpkg-shlibdeps -v -v ruby
dpkg-shlibdeps: debug: >> Scanning ruby (for Depends field)
dpkg-shlibdeps: debug: Library libruby.so.2.5 found in /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: debug: Skipping lib /lib/i386-linux-gnu/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /lib32/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /libx32/libc.so.6, libabi=0x0101003e00000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Skipping lib /lib32/libc.so.6, libabi=0x0101000300000000 != objabi=0x0201003e00000000
dpkg-shlibdeps: debug: Library libc.so.6 found in /lib/x86_64-linux-gnu/libc.so.6
dpkg-shlibdeps: debug: No associated package found for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: debug: Using shlibs+objdump for libruby.so.2.5 (file /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5)
dpkg-shlibdeps: debug:  Looking up shlibs dependency of libruby.so.2.5 provided by ''
dpkg-shlibdeps: debug:  Found nothing
dpkg-shlibdeps: debug: No shlibs+objdump info available, trying next package for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5
dpkg-shlibdeps: error: no dependency information found for /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5 (used by ruby)
Hint: check if the library actually comes from a package.

Hmm? When I look at ldd, I find a link called libruby.so. This doesn't seem to be the one I built myself.

$ ldd ruby
        linux-vdso.so.1 (0x00007fff7c5be000)
        libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f27f31ad000)
        libruby.so.2.5 => /home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib/libruby.so.2.5 (0x00007f27f2c79000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f27f2888000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f27f2684000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f27f2465000)
        libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f27f21e4000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f27f1fac000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f27f1c0e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f27f35b6000)

If you want to know the argument of configure for the time being, you can use RbConfig :: CONFIG.

$ irb
irb(main):001:0> RbConfig::CONFIG["configure_args"]
=> " '--prefix=/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8' '--enable-shared' 'LDFLAGS=-L/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib ' 'CPPFLAGS=-I/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/include '"

The option --enable-shared is like that.

I see.


The word is not good because there is such a thing at the time of build.

irb(main):002:0> RbConfig::CONFIG["CXXFLAGS"]
=> "-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict"
irb(main):003:0> RbConfig::CONFIG["CFLAGS"]
=> "-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict  -fPIC"
irb(main):004:0> RbConfig::CONFIG["LDFLAGS"]
=> "-L. -L/home/kubo39/.anyenv/envs/rbenv/versions/2.5.8/lib  -fstack-protector -rdynamic -Wl,-export-dynamic"


I don't know why, but the one I put in with rbenv doesn't have the Makefile configured, let alone the source code (I think I'm building from the source, so I'm erasing it. Capacity reduction?) Instead, take a look at the one you built yourself.

$ ./configure --help| grep enable-shared
  --enable-shared         build a shared library for Ruby

Well, that's right, but why does the ruby ​​binary itself depend on it? I think it's for the C extension library, but I didn't understand.

Recommended Posts

If you want to know the options when configuring Ruby, see `RbConfig :: CONFIG ["configure_args "]`
[Swift] When you want to know if the number of characters in a String matches a certain number ...
When you want to use the method outside
[Ruby] When you want to replace multiple characters
If you want to recreate the instance in cloud9
When you want to change the MySQL password of docker-compose
[PostgreSQL] If you want to delete the Rails app, delete the database first!
A memorandum when you want to see the data acquired by Jena & SPARQL for each variable.
If you want to include the parent class in Lombok's @builder
When you want to ZIP download the image data saved locally
Want to know what Ruby n is the power of 2? (Power judgment of 2)
If you want to change the Java development environment from Eclipse
What to do when you want to know the source position where the method is defined in binding.pry
A memo when you want to clear the time part of the calendar
I want to know the JSP of the open portlet when developing Liferay
If you want to make a zip file with Ruby, it's rubyzip.
Ruby on Rails When you don't know the cause of rollback when saving.
If you want to satisfy the test coverage of private methods in JUnit
If you are using Android Room and want to change the column definition
If you want to modify database columns etc.
When you want to bind InputStream in JDBI3
[Ruby] When you want to assign the result obtained by conditional branching to a variable and put it in the argument
I want to get the value in Ruby
If you use SQLite with VSCode, use the extension (how to see the binary file of sqlite3)
[rails] After option useful when you want to change the order of DB columns
If hash [: a] [: b] [: c] = 0 in Ruby, I want you to extend it recursively even if the key does not exist.
When the hover of Eclipse is hard to see
If you want to separate Spring Boot + Thymeleaf processing
I want to know the answer of the rock-paper-scissors app
If you want to use Mockito with Kotlin, use mockito-kotlin
When you want to dynamically replace Annotation in Java8
[Ruby + Rails] When you want to register in Mailchimp's mail list together with user registration
What to do if you don't see the test code error message in the terminal console
When you want to change the wording to be displayed when making a select box from enum
What to do if you installed Ruby with rbenv but the version does not change
Use JLine when you want to handle keystrokes on the console character by character in Java
When you want to reflect the Master Branch information in the Current Branch you are currently working on