Rubygems 1.8.24 install using --prefix #383

Razzell opened this Issue Oct 4, 2012 · 4 comments


None yet

5 participants


When packaging ruby 1.8.x with rubygems, it's necessary to specify "ruby setup.rb --prefix=dir" so that the packaging takes place within dir rather than the default install directory.

In earlier version of rubygems, for example 1.6.2, the --prefix option was not present. Instead the directory was inferred from ruby. Rubygems libraries would install correctly into ruby-dir/lib/ruby/site_ruby/abi, and gem would install correctly into ruby-dir/bin, though with an incorrect hashbang.

Now, whenever the new --prefix option is set, for example to ruby-dir so that gem will install correctly into ruby-dir/bin, the libraries are installed not under ruby-dir/lib/ruby/site_ruby/abi but directly under ruby-dir/lib, which is not in the ruby LOAD_PATH. Thus, the use of --prefix causes a broken rubygems install.

This behavior is determined by lib/rubygems/commands/setup_command.rb in method generate_default_dirs(install_destdir). If the --prefix option is unspecified, then lib_dir is set from the config map, producing a path correctly containing lib/ruby/site_ruby/abi . Otherwise, it's incorrectly concatenated from dir/lib.


I see the same behavior. From what I can see, this is also true for 1.8.23

RubyGems member

This is not how --prefix is intended to work. Perhaps you are looking for --destdir?

I don't know how the setup options for packagers are supposed to work, though. You may need to provide me with a patch that must include tests. Without tests I will not apply it as it may break again.

RubyGems member

Is this issue still applicable, or can it be closed?


Yes, closing. I have vague recollections of being involved in the original discussion of adding --destdir to rubygems setup because of packaging. This also doesn't apply because rubygems is internally packaged with ruby itself now. That wasn't the case back in the 1.8.x days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment