I'm trying to figure out how to launch a macruby app (with a cocoa UI) from the command line without relying on xcode or xcodebuild. The problem i'm running into is that the NSBundle.mainBundle is not being set when I run the app from the command line. I've tried using this: macruby -C. myApp.rb But that doesn't set the bundle to the current directory and I get this error: No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting Is it possible to run a macruby app from the command line? Should I be using macrubyc to do this? Thanks, Corey
On 16 Oct 2010, at 19:04, corey johnson wrote:
I'm trying to figure out how to launch a macruby app (with a cocoa UI) from the command line without relying on xcode or xcodebuild. The problem i'm running into is that the NSBundle.mainBundle is not being set when I run the app from the command line. I've tried using this:
macruby -C. myApp.rb
But that doesn't set the bundle to the current directory and I get this error:
No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
Is it possible to run a macruby app from the command line? Should I be using macrubyc to do this?
Assuming you have a valid app then open name.app will run the the named app from the command line. e.g. open mail.app will run the mail app the same as double clicking on the icon. Dave.
Thanks, Corey _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Sat, Oct 16, 2010 at 11:46 AM, Dave Baldwin <dave.baldwin@dsl.pipex.com> wrote:
Assuming you have a valid app then
open name.app
That is where I'm running into problems. How do I compile my app into a .app file without xcode or xcodebuild? I would think it should be possible directly from the command line with the `macruby` command. Corey
MacRuby itself doesn't provide you with this feature, however you can look into HotCocoa and see how it's done. - Matt On Sun, Oct 17, 2010 at 4:49 PM, corey johnson <probablycorey.spam@gmail.com
wrote:
On Sat, Oct 16, 2010 at 11:46 AM, Dave Baldwin <dave.baldwin@dsl.pipex.com> wrote:
Assuming you have a valid app then
open name.app
That is where I'm running into problems. How do I compile my app into a .app file without xcode or xcodebuild? I would think it should be possible directly from the command line with the `macruby` command.
Corey _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Corey, I could be wrong - I'm pretty new to MacRuby myself - but my understanding is that MacRuby is an only an interpreter, equivalent to other Ruby implementations. To get a fully-compiled Mac binary, you still need to use a compiler like XCode to generate a .app file. Jeff On Sun, Oct 17, 2010 at 6:49 PM, corey johnson <probablycorey.spam@gmail.com
wrote:
On Sat, Oct 16, 2010 at 11:46 AM, Dave Baldwin <dave.baldwin@dsl.pipex.com> wrote:
Assuming you have a valid app then
open name.app
That is where I'm running into problems. How do I compile my app into a .app file without xcode or xcodebuild? I would think it should be possible directly from the command line with the `macruby` command.
Corey _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On 18 Oct 2010, at 00:49, corey johnson wrote:
On Sat, Oct 16, 2010 at 11:46 AM, Dave Baldwin <dave.baldwin@dsl.pipex.com> wrote:
Assuming you have a valid app then
open name.app
That is where I'm running into problems. How do I compile my app into a .app file without xcode or xcodebuild? I would think it should be possible directly from the command line with the `macruby` command.
Have a look at the rakefile here /Developer/Examples/Ruby/MacRuby/Sketch/Rakefile This will show you what you need to do to make a MacRuby app without xcode. Dave.
Corey _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Corey, As some already figured it out, you need to create an application bundle (.app) around your MacRuby script (with an Info.plist file, and so on), then run it from the command-line. macrubyc can be used to compile your script into a binary executable, but you still need to wrap it inside a .app bundle in order to get your app running as a regular Cocoa app. HTH, Laurent On Oct 16, 2010, at 11:04 AM, corey johnson wrote:
I'm trying to figure out how to launch a macruby app (with a cocoa UI) from the command line without relying on xcode or xcodebuild. The problem i'm running into is that the NSBundle.mainBundle is not being set when I run the app from the command line. I've tried using this:
macruby -C. myApp.rb
But that doesn't set the bundle to the current directory and I get this error:
No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
Is it possible to run a macruby app from the command line? Should I be using macrubyc to do this?
Thanks, Corey _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (5)
-
corey johnson
-
Dave Baldwin
-
Jeff Cohen
-
Laurent Sansonetti
-
Matt Aimonetti