Skip to content

Instantly share code, notes, and snippets.

@kimuraw
Created November 19, 2011 07:02
Show Gist options
  • Save kimuraw/1378574 to your computer and use it in GitHub Desktop.
Save kimuraw/1378574 to your computer and use it in GitHub Desktop.
patch: fix "invalid option -N (-h will show valid options)" to run rubycocoa apps on Xcode-4
diff -ur old/main.m new/main.m
--- old/main.m 2011-11-19 15:49:58.000000000 +0900
+++ new/main.m 2011-11-19 15:49:16.000000000 +0900
@@ -11,5 +11,6 @@
int main(int argc, const char *argv[])
{
- return RBApplicationMain("rb_main.rb", argc, argv);
+ RBApplicationInit("rb_main.rb", argc, argv, nil);
+ return NSApplicationMain(argc, argv);
}
diff -ur old/rb_main.rb new/rb_main.rb
--- old/rb_main.rb 2011-11-19 15:49:58.000000000 +0900
+++ new/rb_main.rb 2011-11-19 15:49:16.000000000 +0900
@@ -17,7 +17,4 @@
end
end
-if $0 == __FILE__ then
- rb_main_init
- OSX.NSApplicationMain(0, nil)
-end
+rb_main_init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment