Removing visibility flag hiding required symbols in ruby binary.
Makes sure all libruby symbols are available from within the executable after final linking. Fixes ruby-debug19, passenger, and many other extensions.
Makes sure all libruby symbols are available from within the executable after
final linking. Fixes ruby-debug19, passenger, and many other extensions.
+1 (Only because this issue doesn't seem to be getting much love)
The correct solution for ruby-debug19 at least is to install the latest gems available from the rubyforge page:
These haven't been pushed to rubygems.org so nobody thinks they exist.
@sj26 What, exactly should be required to install these? I'm noticing / unsure about a couple of things.
When installing 1.9.3-p0 from source (autoconf -f && ./configure --prefix=/whatever && make && make install), or from rbenv. The following directory does not exist: $PREFIX/include/ruby-1.9.1/ruby-1.9.3-p0 - this appears to be required, as it contains a bunch of header files that appear to be important to compiling the native extensions. (What am I doing wrong?)
autoconf -f && ./configure --prefix=/whatever && make && make install
Is the symbol visibility patch still required? I noticed on the rubyforge thread that people were discussing that they were somehow private symbols, and Gems shouldn't be using them?
What role does the ruby-core-source gem play? Does that relate to my first point?
Thanks, sincerely - this is really stopping my team upgrading, so far we're using this home-grown build process which appears to work.
@sj26 I just noticed that you are Sam Cochran, and that it was your notes from the blog post dated 31.10.2011 that I've been referring to, including how to make sure the symbol exists.
The trick about making sure that $PREFIX/include/ruby-1.9.1/ruby-1.9.3-p0 exists (because it doesn't on many builds I have seen) came from somewhere else, but seemed to help. Especially in cases where the extracted tar-sources are not preserved (e.g. rbenv)
This works for me repeatably:
rbenv install 1.9.3-p0
rbenv local 1.9.3-p0
gem install *.gem -- --with-ruby-include=$(echo ~/.rbenv/versions/1.9.3-p0/include/ruby-1.9.1/ruby-1.9.3-p0/) --no-rdoc --no-ri
rbenv install from ruby-build.
Verified working with:
$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
irb(main):001:0> require 'ruby-debug'
irb(main):002:0> Debugger.start and puts Debugger.current_context
If you are using bundler, firstly I recommend 1.1 (install with --pre) as it's so much faster. But secondly bundler will detect the already installed Gems from above, and you won't have to care about bundle config or any build problems when installing your bundle.
You may want to cp the gems from above into your project's ./vendor/cache directory, so that Bundler doesn't fail to download them from rubygems.org.
My Gemfile entry for the above looks like:
group :development, :test do
gem 'ruby_core_source', '0.1.5', :require => false
gem 'linecache19', '0.5.13'
gem 'ruby-debug-base19', '0.11.26'
gem 'ruby-debug19', '0.11.6'
Additionally this only cures the ruby-debug problems, rack-perftools.rb et al still don't work.
I also had to upgrade rspec to 2.8.0, and remove --debug from my .rspec file. (With --debug, rspec tries to call require 'ruby-debug', which doesn't work, as its now require 'ruby-debug19' since ruby-debug-0.11.6 (maybe even sooner, but at least in 0.11.6).