(Note - as of very recent builds (1366 and later), the builds on http://deadlock.netbeans.org/hudson/job/ruby/ provide a prepackaged Mac OS X application bundle, based on the below instructions.)
Packaging the RubyNetBeans IDE as an Application
The Ruby only IDE, linked to from RubyInstallation, can be packaged and used as a regular Mac OS X application. To do this, there are a few steps to follow.
- Create a RubyNetBeans.app folder on your Desktop.
- Within RubyNetBeans.app (use Show Package Contents to get access if in Finder), create a new folder named Contents.
- In the Contents folder, add an Info_RubyNetBeansOSX.plist file containing the following (taken from Netbeans 6.0 dev, as it meets our immediate needs, and a copy of this file is also attached to this Wiki page):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleExecutable</key> <string>nbrubyide</string> <key>CFBundleIconFile</key> <string>icons.icns</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>Base IDE</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>6.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>220.127.116.11.200705021220</string> </dict> </plist>
- Add a Resources subfolder to the Contents folder.
- Unzip the netbeans-rubyide.zip distribution into the Resources folder, or unzip and move the contents over. The Resources folder should now contain the nbrubyide folder from the zip.
- In a Terminal window, change directory to the Resources folder, and link to the icns file:
ln -s nbrubyide/nb6.0/netbeans.icns icons.icns
- Add a MacOS subfolder to the Contents folder.
- In the Terminal, change directory to the MacOS folder, and link to the nbrubyide executable:
ln -s ../Resources/nbrubyide/bin/nbrubyide nbrubyide
If everything went well, double clicking the RubyNetBeans icon on your desktop will run the Ruby only IDE.
Update the RubyNetBeans Package Icon
The Package icon for our new package can now be fixed:
- Right (or ctrl) click the RubyNetBeans.app icon, and select Get Info.
- Single click the icon representing the .app that can be found at the top of the Info window, and hit backspace. This will have the package re-initialise it's icon.
Fix RubyNetBeans Java Runtime Dock Icon - For Versions Before May26th build#3
Prior to the May26th build#3, the nbrubyide executable would not correctly show the dock icon when running, but this has been fixed in the latest builds. Should you need to run an earlier version, you can fix the problem manually. Edit the nbrubyide file, in RubyNetBeans.app/Contents/Resources/nbrubyide/bin, and locate the following:
Remove that forward slash. It should now look like:
Save the file, and that should fix the dock Icon when RubyNetBeans runs
With the above steps completed, the RubyNetBeans.app can be moved to the /Applications folder, or wherever else you feel happy to have it installed. It can then be dragged to the dock, and will act as a regular .app, with a proper icon (a Ruby style icns file would be even better of course), and no multiple icon ugliness.
Updating the IDE version
When the latest Ruby only IDE is released, you can simply unzip it and replace the nbrubyide folder in RubyNetBeans.app/Contents/Resources.
Persisting Your Settings
If you need you own custom settings, as I do for UTF-8 encoding, you can set these in
default_options="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dfile.encoding=UTF-8"
Changes made in your user settings will persist across IDE updates, which is great, but it's worth checking your latest distribution nbrubyide.conf after long periods, in case the options are updated.