简体   繁体   English

wxWidgets (wxRuby) 与 Ruby 2.0

[英]wxWidgets (wxRuby) with Ruby 2.0

I'm looking for an Win32 wxRuby gem for Ruby 2.0, does someone know where to find it?我正在寻找适用于 Ruby 2.0 的 Win32 wxRuby gem,有人知道在哪里可以找到吗? I didn't have success trying to build it and it seems the project is dead.我尝试构建它没有成功,而且这个项目似乎已经死了。

I'm still on the battle, I successfully built wxRuby using Ruby 2.3 on linux Ubuntu (Xenial 16.04) and Mint (17 and 18), for both i386 and amd64, testing and using instructions from here and here :我仍在战斗中,我在 linux Ubuntu(Xenial 16.04)和 Mint(17 和 18)上使用 Ruby 2.3 成功构建了 wxRuby,用于 i386 和 amd64,测试和使用来自此处此处的说明

# temporary add this source for a complete libwxgtk2.8
echo "deb http://archive.ubuntu.com/ubuntu precise main universe" | tee /etc/apt/sources.list.d/precise-copies.list
apt update

# install required packages
apt-get install libwxgtk2.8-dev libglib2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev pangox-1.0-dev build-essential curl git

# install recommended swig version
wget "http://downloads.sourceforge.net/project/swig/swig/swig-1.3.38/swig-1.3.38.tar.gz?r=&ts=1471028964&use_mirror=ufpr" -O swig-1.3.38.tar.gz
tar zxvf swig-1.3.38.tar.gz
cd swig-1.3.38
./configure
make -j8
make install

# install ruby, using RVM
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.3.0

# wxRuby
git clone https://github.com/cinnammon/wxRuby-ng
cd ~/wxRuby-ng
export WXRUBY_EXCLUDED=GLCanvas
export WXRUBY_VERSION=2.0.1
# add "Config = RbConfig unless defined?(Config)" to the top of ./rakefile
# and change 'raise "This version of Ruby (#{RUBY_VERSION}) is not supported"'
# on line 38 for "SWIG_MINIMUM_VERSION = '1.3.37'"
rake
# I got some "extern" "static" declaration errors on some files,
# just changed "static" to "extern" and all went well
rake install

# remove source
rm /etc/apt/sources.list.d/precise-copies.list
apt update

I will keep trying to port it to Windows or maybe stick to Linux, but will update this post :)我会继续尝试将它移植到 Windows 或者坚持使用 Linux,但会更新这篇文章:)

Latest ruby version which supports wxruby gem is 1.9.1 (gem is named wxruby-ruby19, gem named wxruby is dedicated for ruby 1.8) and wxruby project is no longer developed.支持 wxruby gem 的最新 ruby​​ 版本为 1.9.1(gem 名为 wxruby-ruby19,名为 wxruby 的 gem 专用于 ruby​​ 1.8),不再开发 wxruby 项目。 So if you need to use ruby 2.0 you are on your own now.因此,如果您需要使用 ruby​​ 2.0,您现在就自己解决。 But try to ask at http://www.ruby-forum.com/forum/wxruby where some of former wxruby developers are still active and eager to help.但是尝试在http://www.ruby-forum.com/forum/wxruby上询问一些前 wxruby 开发人员仍然活跃并渴望提供帮助的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM