开发者

Is there any crossplatform GUI for Ruby that is easy to install on Mac OS?

开发者 https://www.devze.com 2023-04-01 04:13 出处:网络
I have some ruby scripts for end users that will be nice to have some GUI. Some of users use Windows, some Mac OS X (Snow Leopard, Lion). So i need some kind of cross-platform GUI that my users can ea

I have some ruby scripts for end users that will be nice to have some GUI. Some of users use Windows, some Mac OS X (Snow Leopard, Lion). So i need some kind of cross-platform GUI that my users can easily install. For Windows where is built-in Tk and a number of gems that can be installed as easy as gem install wxRuby. But on MacOS i have some problems:

  • No built-in Tk due to 64-it nature of Snow Leopard+ and no easy way to install it.
  • qtRuby4 gem does not exist for Mac OS X at all.
  • gtk2 gem is native and fails to build on Mac OS X Snow Leopard+
  • wxruby gem install but will not work on 64-bit Snow Leopard+, scripts need to be executed manually in 32-bit mode.

Maybe someone can suggest some distribution / way to install GUI toolkit for ruby that will be easy to install for end users for both Wind开发者_StackOverflow中文版ows and Mac OS X Snow Leopard / Lion? Or the wxRuby is the only way and i need to somehow make sure that end users execute scripts in 32-bit mode?


I haven't used it, but Shoes may fit the bill.


There was a Ruby GUI survey in 2008, which would need an update. Maybe it's still interesting though:

http://www.pressure.to/ruby_gui_survey/

IMHO from your list your best bet is wxRuby, sans the 32-bit limitation. An alternative way would be to wrap up your application as a lightweight web app using something like Sinatra, starting a server on localhost and telling the user where to go in the browser. That is if doing GUIs in JavaScript is your thing.


Ok, for now it seems that the easiest way will be to use Ruby-GNOME2. The instruction to configure ruby for OSX will be to install macports via standard .dmg installer and execute one command:

sudo -s "port selfupdate; port install ruby; gem install gtk2"

Of course installing something is not very user-friendly, but manual tinkering with 32-bit / 64-bit interpreter execution for wxRuby afraids me more. That will require either to modify end user system or to add some kind of bootstrapper into each script so it will check if executed on 64-bit macos and in such case relaunch itself in 32-bit interpreter.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号