How to compile?

33 views
Skip to first unread message

Rui Lopes

unread,
May 17, 2009, 3:32:51 PM5/17/09
to ebbebb
Hi,

I'm a bit puzzled on how to compile ebb under ruby 1.9. I've tried
with:

git clone git://github.com/ry/ebb.git
cd ebb
rake-1.9

It build libev, ebb_ffi.so but didn't install anything. So, I next
tried:

rake-1.9 gem
gem-1.9 install pkg/ebb-0.3.3.gem

The gem was build and all, but it only installed the C source code;
no .so file and no .rb files. Isn't that odd?

Next, I uninstalled the gem, and tried to install using the normal:

gem-1.9 install ebb

Which installed ebb 0.3.2, but oddly, it only installed C source code,
and again, no .so file and no .rb files.

I'm kinda lost... how can I build ebb from source?

TIA.

Best regards,
Rui Lopes

Dharmarth

unread,
Jun 2, 2009, 4:40:31 AM6/2/09
to ebbebb
Ry,
I made the following changes to get ebb compiling on Ruby 1.9.
Specifically, the version I have running at my end is version 1.9.1p0
(2009-01-30 revision 21907) [i686-linux].

1. I have added conditional include for TRAP_BEG and TRAP_END
macros (that were used to save errno) and “rubysig.h”. These have been
marked obsolete in version 1.9 and are not required in it.

2. The gem was getting built successfully but the .rb files were
missing in it. I have included .rb files in the gem specification.

After successful installation, I got another error while accessing an
application deployed on ebb.


/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:105:in `rescue in const_missing':
uninitialized constant Rack::Adapter::Rails::CGIWrapper::Thin
(NameError)
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:94:in `const_missing'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/rack/adapter/
rails.rb:123:in `header'
from /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/cgi_process.rb:55:in `dispatch_cgi'
from /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/dispatcher.rb:102:in `dispatch_cgi'
from /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/dispatcher.rb:28:in `dispatch'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/rack/adapter/
rails.rb:57:in `serve_rails'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/rack/adapter/
rails.rb:77:in `call'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/ebb.rb:88:in
`block in process'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/ebb.rb:87:in
`catch'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/ebb.rb:87:in
`process'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/ebb.rb:75:in
`start_server'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/lib/ebb/runner.rb:
120:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/ebb-0.3.3/bin/ebb_rails:5:in
`<top (required)>'
from /usr/local/bin/ebb_rails:19:in `load'
from /usr/local/bin/ebb_rails:19:in `<main>'


This looked like an issue of using "Thin.ruby_18?" (Line 123 of rack/
adapter/rails.rb), used to check the ruby version. Replacing this with
"RUBY_VERSION =~ /^1\.8/" resolved out the issue.

After making all the above changes, ebb now runs successfully on both
Ruby 1.8 and 1.9. I have committed all the changes in my fork and sent
you a pull request. Please do have a look on it.

http://github.com/dharmarth/ebb/tree/master


Rui,
You can refer my fork till these changes appear in the main
repository.


Thanks,
Dharmarth
Impetus Technologies

Ry Dahl

unread,
Jun 2, 2009, 5:05:00 AM6/2/09
to ebbebb
Hi Dharmarth,

Looks good. One issue:

In lib/ebb.rb, you made the change

- autoload :FFI, LIBDIR + '/../ext/ebb_ffi'
+ autoload :FFI, LIBDIR + '/ebb_ffi'

Is there a reason for this? On my system, at least, I cannot run ebb
from its build directory.

ry

Dharmarth

unread,
Jun 2, 2009, 11:47:49 AM6/2/09
to ebbebb
Ry,

Sorry, I forgot to mention about this change.

- autoload :FFI, LIBDIR + '/../ext/ebb_ffi'

On my Ruby 1.9 setup, the execution just used to get stuck at this
line. (Strangely, no exception was thrown either). To get it to work,
I just tried replacing it and did not get the time to give it a deep
thought and analyze the root cause.

To get it working from the build directory as well, and avoid that
(environmental?) issue in Ruby 1.9, I can guess we can better use the
following in place of the above statement. (I did a quick check and it
seems to be working fine)


+ autoload :FFI, File.expand_path(LIBDIR + '/../ext/ebb_ffi')


Thanks,
Dharmarth
Impetus Technologies

ry

unread,
Jun 3, 2009, 6:58:06 PM6/3/09
to ebbebb
Thanks. Your changes are pulling into my branch.
Reply all
Reply to author
Forward
0 new messages