[Rubygems-developers] repackaging rubygems and no such file to load -- rubygems (LoadError)

Chad Woolley thewoolleyman at gmail.com
Wed Apr 11 23:32:57 EDT 2007


Here's what I do to make a test installation of rubygems:

  class RubyGemsInstaller
    attr_writer :install_dir
    attr_writer :rubygems_dist_dir

    def install
      install_dir = File.expand_path(@install_dir)
      rubygems_dist_dir = File.expand_path(@rubygems_dist_dir)
      ENV['GEM_HOME'] = "#{install_dir}"
      setup_cmd = "ruby setup.rb"
      Dir.chdir("#{rubygems_dist_dir}") do
        `#{setup_cmd} config --prefix=#{install_dir}`
        `#{setup_cmd} setup`
        `#{setup_cmd} install`
      end
    end
  end

...although I've never done this on a system without rubygems already
installed, and I still end up using the executables from the main
installation.

-- Chad

On 4/11/07, m. zeckinger <m.zecko at gmail.com> wrote:
> hello guys, i came across the part in you faq that says "No such file
> to load—rubygems", because i experience the same problem.
> your answer still didn't tell me much about what can be the real
> problem there. i am currently trying to repackage software on osx,
> (ruby and rubygems), to be included in an installer-package.
> how would i install rubygems in this case?
> i tried it the following way:
>
> ruby setup.rb config --prefix=/usr/local
> ruby setup.rb install
> --prefix=/UB/compile/Distribution_folder/Package_Root/usr/local
>
> but still, when i install the package on another system, i get the errors.
> /usr/local/bin/gem:9:in `require': no such file to load -- rubygems (LoadError)
>         from /usr/local/bin/gem:9
>
>
> another try:
> PREFIX="/UB/compile/Distribution_folder/Package_Root/usr/local"
> GEM_HOME=$PREFIX/lib/ruby/gems/1.8
> RUBYLIB=$PREFIX/lib/ruby:$PREFIX/lib/site_ruby/1.8
>
> ruby setup.rb config --prefix=/usr/local
> ruby setup.rb install --prefix=$PREFIX
>
> then i tried to deinstall my local ruby and building from the just
> freshly compiled ruby, via
>
> $PREFIX/bin/ruby setup.rb config --prefix=/usr/local
> $PREFIX/bin/ruby setup.rb install --prefix=$PREFIX
>
> which resulted in another problem:
> dyld: Symbol not found: _ruby_init_stack
>   Referenced from:
> /UB/compile/Distribution_folder/Package_Root/usr/local/bin/ruby
>   Expected in: /usr/lib/libruby.dylib
>
> this obviously doesn't work, since i cannot install rubygems from the
> not-yet-installed ruby.
> please, guys, can you make this more clear and tell me what to do to
> repackage rubygems?
>
> thanks a lot!
> mz
> _______________________________________________
> Rubygems-developers mailing list
> Rubygems-developers at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rubygems-developers
>


More information about the Rubygems-developers mailing list