aix - Why might "--enable-load-relative" not work for a ruby install? -


i need install ruby @ several sites, exact location of install may different between various sites.

i configured , compiled using -enable-load-relative. seems work linux install not aix. when configured linux used

--enable-load-relative --prefix=blah --exec-prefix=blah/linux_code_rel 

i able test relative loading doing following: first install dir named linux_code_rel

blah/linux_code_rel/bin/ruby -e " puts 'hello' " 

then after renaming directory linux_code, ran

blah/linux_code/bin/ruby -e " puts 'hello' " 

both times got hello

when did same thing aix, not seem work. configured , installed using

 --enable-load-relative --prefix=blah --exec-prefix=blah/aix_code_rel 

after installing if run

blah/aix_code_rel/bin/ruby -e "puts 'hello' "  

i back

hello 

if rename aix_code_rel aix_code , run

blah/aix_code/bin/ruby -e "puts 'hello' " 

i get

<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (loaderror)         <internal:gem_prelude>:1:in `<compiled>' 

creating symbolic link using ln -s aix_code aix_code_rel, seems fix this, indicates install looking code found using path blah/aix_code_rel , despite fact configured --enable-load-relative

i seem able past setting rubylib env variable, seems messy, given linux install seems work relative loading.

anyone have idea might doing wrong? there other why can set default load_path? maybe post install configuration file?

i've not tried option on aix trick work.

if find executable or shared library (like miniruby or libruby.so.xxxxx) , do:

dump -h miniruby 

you see output shows depends upon. below "import file strings" see list. 0th entry particular executable or shared library uses "libpath". make relative paths. work. introduces security risk (which told of) ruby build process tries avoid.

this if libpath not set in environment. if libpath set in environment, use path in cases.

oh... there exception this. (i'm editing i'm typing) 1st through nth entries in import file strings list can absolute paths in case not libpath alter search since there no search done.

what might work wrapper "ruby" in script sets libpath , exec's ruby using same arguments. like:

#!/bin/sh export libpath=/blah:/ble/blah:/usr/lib:/lib exec real-ruby "$@" 

the small dance have or worry if ruby looks @ argv[0] , different things based upon name. don't think does. , other part might need set gem_home , of other ruby environment variables.

the other real world suggesting create symlink suppose installed place installed. bin , lib directory , might work well.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -