I have tried to install RubyCocoa and received the following error:
bash-2.05a$ ruby install.rb config
install.rb: entering config phase…
create ext/rubycocoa/extconf.rb
create ext/rubycocoa/rubycocoa.m
create framework/RubyCocoa.pbproj/project.pbxproj
create framework/src/objc/RBObject.h
create framework/src/objc/RBSlaveObject.h
create framework/src/objc/RubyCocoa.h
create framework/src/objc/Version.h
—> framework
create
/Users/markwils/Desktop/Ruby/tarballs/rubycocoa-0.4.0/framework/src/
objc/osx_ruby.h …
/Users/markwils/Desktop/Ruby/tarballs/rubycocoa-0.4.0/framework/post-
config.rb:15: [BUG] Segmentation fault
ruby 1.6.8 (2002-12-24) [powerpc-darwin6.3]
Abort trap
As you can see from the above, I am using ruby 1.6.8. I am also using
10.2.3 and the December developer tools. If anyone has any insight on
this, I would appreciate the help. Thank you.
Mark Wilson
I have tried to install RubyCocoa and received the following error:
bash-2.05a$ ruby install.rb config
install.rb: entering config phase…
create ext/rubycocoa/extconf.rb
(snip)
—> framework
create
/Users/markwils/Desktop/Ruby/tarballs/rubycocoa-0.4.0/framework/src/
objc/osx_ruby.h …
/Users/markwils/Desktop/Ruby/tarballs/rubycocoa-0.4.0/framework/post-
config.rb:15: [BUG] Segmentation fault
ruby 1.6.8 (2002-12-24) [powerpc-darwin6.3]
Abort trap
As you can see from the above, I am using ruby 1.6.8. I am also using
10.2.3 and the December developer tools. If anyone has any insight on
this, I would appreciate the help. Thank you.
I saw a same error. The error occur in rb_gc_mark() of ruby 1.6.8.
It seem that the error doesn’t occur in ruby 1.6.7 and 1.8pre. I
cannot figure out why, but a following patch will fix the bug.
$ cd {rubycocoa-0.4 source directory}
$ patch -p0 < following-patch
thanks,
···
At Sat, 11 Jan 2003 15:08:06 +0900, Mark Wilson wrote:
FUJIMOTO Hisakuni
Index: framework/post-config.rb
RCS file: /cvsroot/rubycocoa/src/framework/post-config.rb,v
retrieving revision 1.4
diff -u -b -u -r1.4 post-config.rb
— framework/post-config.rb 19 Dec 2002 08:41:50 -0000 1.4
+++ framework/post-config.rb 11 Jan 2003 14:02:17 -0000
@@ -12,10 +12,9 @@
$stderr.puts “create #{File.expand_path(dst_fname)} …”
File.open(dst_fname, ‘w’) do |dstfile|
IO.foreach(src_path) do |line|
-
line = line.gsub( /\bID\b/, 'RB_ID' )
-
line = line.gsub( /\bT_DATA\b/, 'RB_T_DATA' )
-
line = line.gsub( /\bintern.h\b/, "#{new_filename_prefix}intern.h" )
-
dstfile.puts line
-
line.gsub!( /\b(ID|T_DATA)\b/, 'RB_\1' )
-
line.gsub!( /\bintern\.h\b/, "#{new_filename_prefix}intern.h" )
-
dstfile.puts( line )
end
end
end
I’m having a little trouble with some of the RubyCocoa examples (in
particular, the Ruby scripts that call on the Cocoa framework).
After installing RubyCocoa I can run the sample .app files (including
the ones that I build with pbx). But I can’t run the Ruby scripts.
For example
$ ruby sndplay2.rb
/usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in require': No such file to load -- osx/objc/cocoa (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12 from sndplay.rb:1:in
require’
from sndplay.rb:1
The following is what happens after I copy the objc directory and its
contents from
{rubycocoa directory}/framework/src/osx/objc
to
/usr/local/lib/ruby/site_ruby/1.8/osx/
$ ruby sndplay2.rb
/usr/local/lib/ruby/site_ruby/1.8/osx/objc/oc_object.rb:15: undefined
superclass ObjcID' (TypeError) from /usr/local/lib/ruby/site_ruby/1.8/osx/objc/oc_all.rb:13:in
require’
from /usr/local/lib/ruby/site_ruby/1.8/osx/objc/oc_all.rb:13
from
/usr/local/lib/ruby/site_ruby/1.8/osx/objc/foundation.rb:1:in require' from /usr/local/lib/ruby/site_ruby/1.8/osx/objc/foundation.rb:1 from /usr/local/lib/ruby/site_ruby/1.8/osx/objc/cocoa.rb:11:in
require’
from /usr/local/lib/ruby/site_ruby/1.8/osx/objc/cocoa.rb:11
from /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in
require' from /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12 from sndplay2.rb:1:in
require’
from sndplay2.rb:1
Any help would be appreciated.
Mark Wilson
Hi,
After installing RubyCocoa I can run the sample .app files (including
the ones that I build with pbx). But I can’t run the Ruby scripts.
For example
$ ruby sndplay2.rb
/usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in require': No such file to load -- osx/objc/cocoa (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12 from sndplay.rb:1:in
require’
from sndplay.rb:1
I guess the following:
- More than one ruby is installed in your system.
- Old RubyCocoa is installed for some ruby(s).
- the ‘ruby’ command is related with the old RubyCocoa.
So, the ‘ruby’ command is related with old RubyCocoaa installed
previously instead of new one. If you show the following
information, someone can maybe help you.
$ which ruby
$ ruby -e ‘p $:’
$ ruby --version
$ grep -n ‘require’ /usr/local/lib/ruby/site_ruby/1.8/osx/cocoa.rb
Launch sample/SimpleApp.app, do ‘about SimpleApp…’, get ruby
version.
The following is what happens after I copy the objc directory and its
contents from
{rubycocoa directory}/framework/src/osx/objc
to
/usr/local/lib/ruby/site_ruby/1.8/osx/
hmm. This is wrong. In RubyCocoa 0.4, every ruby program of the
framework must be put in the appropriate place in
RubyCocoa.framework. The programs which must be put in the
$LOAD_PATH are only some stubs to load the framework from a
ordinary ruby script.
cheers,
···
At Mon, 13 Jan 2003 11:45:24 +0900, Mark Wilson wrote:
FUJIMOTO Hisakuni