wxWidgets (wxRuby) with Ruby 2.0 - ruby

I'm looking for an Win32 wxRuby gem for Ruby 2.0, does someone know where to find it? 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:
# 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 :)

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. So if you need to use ruby 2.0 you are on your own now. 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.

Related

Installing Ruby 2.3 on WSL (Windows Subsystem for Linux)

First off, sorry for my bad English.
I'm trying to install Ruby 2.3.0 on my system with rbenv via Windows Subsystem for Linux aka Ubuntu on Windows 10. I followed this instruction (but not 100% exactly). but every time I try, It fails to build Ruby with this log.
check struct members..
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh..............................
Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).
Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.
Can't find X11 libraries.
So, can't make tcltklib.so which is required by Ruby/Tk.
Failed to configure tk. It will not be installed.
Failed to configure tk/tkutil. It will not be installed.
configuring zlib
make[1]: Entering directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1'
make -C ext/digest/sha2 -w --jobserver-fds=6,7 -j V= realclean
make[2]: Entering directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1/ext/digest/sha2'
Makefile:39: *** missing separator. Stop.
make[2]: Leaving directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1/ext/digest/sha2'
make[1]: *** [ext/digest/sha2/realclean] Error 2
make[1]: Leaving directory `/tmp/ruby-build.20160522033606.7696/ruby-2.3.1'
make: *** [build-ext] Error 2
and this is my installed package list
libx11-data/trusty,now 2:1.6.2-1ubuntu2 all [installed]
libx11-dev/trusty,now 2:1.6.2-1ubuntu2 amd64 [installed]
libx11-doc/trusty,now 2:1.6.2-1ubuntu2 all [installed,automatic]
libx11-xcb1/trusty,now 2:1.6.2-1ubuntu2 amd64 [installed,automatic]
libtk8.4/trusty,now 8.4.20-7 amd64 [installed,automatic]
libtcl8.4/trusty,now 8.4.20-7 amd64 [installed,automatic]
As you see, I installed X11, tcl, tk but my system can't detect them.
Have I done wrong? or it is just a bug?
Any help would be appreciated. Thank you for reading.
My installation follow this tutorial, go there for most recent update: link here.
1. Install Ruby
First some dependencies for Ruby:
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
Now for Ruby: there are 3 ways to install, each way conflict with each other, so choose one you think fit yours most or my suggestion: rbenv
Using rbenv (recommend)
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
Using rvm
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.3.1
rvm use 2.3.1 --default
ruby -v
From the source
cd
wget http://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz
tar -xzvf ruby-2.3.1.tar.gz
cd ruby-2.3.1/
./configure
make
sudo make install
ruby -v
After install Ruby, install Bundler
gem install bundler
2. Install Rails
First you need NodeJS:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
Then install rails:
gem install rails -v 4.2.6
If you're using rbenv, you'll need to run the following command to make the rails executable available:
rbenv rehash
Now that you've installed Rails, you can run the rails -v command to make sure you have everything installed correctly:
rails -v
# Rails 4.2.6
3. Install DB
MySQL:
You can install MySQL server and client from the packages in the Ubuntu repository. As part of the installation process, you'll set the password for the root user. This information will go into your Rails app's database.yml file in the future.
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
PostgreSQL:
Currently, some bug prevents you from installing Postgres correctly, so I recommend you MySQL for now.
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
The Postgres installation doesn't setup a user for you, so you'll need to follow these steps to create a user with permission to create databases. Feel free to replace chris with your username.
sudo -u postgres createuser chris -s
# If you would like to set a password for the user, you can do the following
sudo -u postgres psql
postgres=# \password chris
Final Steps
Now make sure things go right not left
#### If you want to use SQLite (not recommended)
rails new myapp
#### If you want to use MySQL
rails new myapp -d mysql
#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql
# Move into the application directory
cd myapp
# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified
# Create the database
rake db:create
rails server
Make sure you have updated your Windows installation - run 'Windows 10 Upgrade Assistant' and install the Windows 10 Creators Update. Anything before this is riddled with bugs and my rbenv Rails install wouldn't work. If it still won't work after updating Windows to CU then you can always just use rvm instead. You may need to reinstall everything anyway, as its recommended to reinstall/upgrade Ubuntu if you are using WSL.

How to install Ruby on Red hat

I'm trying to install ruby on Red Hat, via an ssh-connection, but it won't work.
I can't use yum install ruby, because I don't have the needed repositories.
I have three options for you:
1) You can install it from sources.
First of all you'll need to install some build tools and libraries.
On Centos/RedHat the easiest way to do it is using yum groupinstall 'Development Tools'.
If this doesn't work you'll need to run at least: yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel the bare minimum to build. Eventually is you have no internet access and just ssh you can SCP the single packages from your machine.
Once installed build tools , if you have internet access on those machines, I suggest also to install RVM to make less painful upgrade and not have to mess around with path definition for the new libraries and binaries.
To install it is quite simple curl -L get.rvm.io | bash -s stable will do the trick and after a rvm install <version> will permit you to install (for this user) any ruby version you want and create gemset without touch the system.
Be aware that installing new gems that need to be build will require to install other devel libraries if they have compiled extensions.
Have also a look to http://rvm.io/rubies/installing for more references about rvm use
Otherwise you can use #hizbul25 tutorial to install std ruby from source.
2) You can use omnibus, https://github.com/opscode/omnibus-ruby, is the package useb by Opscode, Mcollective and other tools to create a selfcontaines VirtualEnvironment for specific application.
You can select the gem and the ruby version you need and it will create a tgz with all you need to run ruby scripts.
This tgz can be uncompressed where you want (ex: /opt/omnibusruby/) and you'll need just to point the shebangs of your scripts to #!/opt/omnybusruby/embedded/ruby-2/bin/ruby or create a an alias /usr/bin/ruby -> /opt/omnybusruby/embedded/ruby-2/bin/ruby.
If you have no internet access at all from the server is probably the best way to prepare the package on your laptop/system and deploy it on the remote.
I recently installed Rails for the CodeReady Containers implementation of OpenShift in RHEL8/Cento8, using an OpenShift quickstart template. And in fact using rbenv now seems the cleanest way to install ruby:
sudo yum groupinstall "Development Tools"
sudo yum install readline-devel openssl-devel
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install -l
rbenv install 2.7.5
rbenv global 2.7.5
ruby -v

Installing RVM on existing ruby1.8 installation

I have a big problem with my Debian server configuration. Someone before me has made a big mess with ruby installation and now i can't manage to get it all working. What i'm trying to do now is to get back to environment, where ruby1.8 is installed and rails app is working correctly with apache+passenger. If it would be working on RVM it would be perfect. Here is the story:
There was ruby 1.8 installed on a server. The person has removed it with sudo apt-get remove ruby1.8 and then installed version 2.0.x manually using those commands:
mkdir /tmp/ruby && cd /tmp/ruby
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
cd ruby-2.0.0-p247
./configure
make
sudo make install
Then, he has removed all the dirs listed by whereis ruby with rm command.
And here i came - i want to install RVM on this server. The problem is, no matter what i do, i get a lot of errors from all sides. Steps i've done:
# Install RVM
curl -L https://get.rvm.io | bash -s stable
# install 1.8.7 version
rvm install 1.8.7
# use 1.8.7
rvm use 1.8.7
# Install gems
bundle install
First thing (and that's just a tip of iceberg) is that i'm not able to start apache2 in cause of the following error:
apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax
error on line 1 of /etc/apache2/mods-enabled/passenger.load: Cannot
load
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/libout/apache2/mod_passenger.so
into server:
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/libout/apache2/mod_passenger.so:
cannot open shared object file: No such file or directory Action
'configtest' failed.
Looks like there is even no /usr/lib/ruby/ dir on my system right now.
The question is: is there any way to reset all ruby-releated libraries on debian to the original state (debian without ruby installed) and install working RVM on top of that? Thanks in advance for any help.
Verify if, Is ruby installed correct by ruby -v
Install phusion passenger
$ sudo gem install passenger
$ sudo passenger-install-apache2-module
and then follow onscreen instructions

problems installing latest ruby version

I need some help here with RVM and installing the latest version of rails on a debian server. please note im not a linux programmer so you'll have to spell out everything for me.
basically i'm trying to upgrade to the newest version of ruby. I'm trying to install that on a debian server that I connect to via VPN. I'm trying to use RVM so far, but when i run the RVM install 1.9.3 from my debian bash prompt it says there are no binary available for that version, then proceeds to try and grab the source from online which fails (probably due to the firewall). basically when it grabs the source folder from online, it grabs a corrupted hunk of junk. I tried downloading the source package myself and if i click the link on the ruby site it blocks it. If i use wget it appears to download it, but the md5 doesnt match and i cant untar it the thing. it says gzip: stdin: the file is not in gzip format.
So! I neeeedddsss to help. What I was thinkin was getting the binary rubies for 1.9.3.. but I'm unsure how really.. I downloaded the tar.gz file on my windows and used winSCP to move it over, and then I can use untar the thing fine.. and then i have an unzipped folder that is the source from the site.. but im unsure where to go from there.. apt-get install doesnt seem to recognize the tar.gz or the untarred folder.. i tried rvm mount and specifying the path to ruby.exe file (ruby-1.9.3-p327/bin/ruby) but then it says unrecognized command line argument and i should see the usage..
Any advice out there? (preferably without 3rd party programs or stuff other the RVM)
thanks
Because you're a novice, I suggest skipping RVM unless you know you need it.
Debian has great way to install Ruby and make it available for all of the system users:
sudo apt-get install ruby1.9.3
You will use the root password to install it this way.
To verify it worked:
ruby -v
That should print out something like this:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
In case you want to install ruby using rvm: Just execute the commands in the same sequence..
$ sudo apt-get install curl git-core ruby
$ \curl -L https://get.rvm.io | bash -s stable
$ sudo apt-get install libssl-dev
$ source ~/.rvm/scripts/rvm
$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
$ rvm install 1.9.3
--give the password for sqlserver or you can just press enter.
$ gem install rails
You have ROR setup now!
Reading back on my questions, I remember now, it WAS the firewall. The firewall where I was working at the time didn't allow me to download ruby source properly. It was downloading, but not actual source, corrupted source. So, I did it at home and it worked fine.
Just thought I'd pop this in here in case anyone ever finds it when problems installing ruby.

How do I install the latest version of ruby in Ubuntu?

I currently have ruby version 1.8.2 in my machine and I would like to upgrade it to 1.9.2. How am i supposed to do it?
I use Ubuntu, and I've found the easiest way to install newer versions of Ruby is to use rvm.
The instructions are here: https://rvm.io/rvm/install/
Basically, it installs different versions of Ruby locally for the user and updates environment variables for Ruby and gems based on which version you decide to use.
It's this easy:
jim#schubert:~$ rvm use system
Now using system ruby.
jim#schubert:~$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
jim#schubert:~$ gem -v
1.3.7
jim#schubert:~$ rvm use 1.9.2
Using /home/jim/.rvm/gems/ruby-1.9.2-p180
jim#schubert:~$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
jim#schubert:~$ gem -v
1.5.2
jim#schubert:~$
I don't like having RVM on production server, so I usually install ruby from source with an install script like this:
#!/bin/bash
tmp_dir="/tmp"
version="2.2.3"
minor_version="2.2"
ruby_version="ruby-$version"
echo "*******************"
echo "* Installing Ruby *"
echo "*******************"
sudo apt-get install -y autoconf build-essential libreadline-dev libssl-dev libyaml-dev zlib1g-dev libffi-dev
mkdir -p "$tmp_dir"
cd "$tmp_dir"
wget "http://cache.ruby-lang.org/pub/ruby/$minor_version/$ruby_version.tar.gz"
tar -xvzf $ruby_version.tar.gz
cd $ruby_version
./configure --disable-install-doc
make --jobs `nproc`
sudo make install
cd ..
rm $ruby_version.tar.gz
rm -rf $ruby_version
echo "*******************"
echo "* Ruby installed! *"
echo "*******************"
1 Install RVM:
https://rvm.io
2 Then install Ruby 1.9.2
rvm install 1.9.2
Since the original question was about the latest version, here is how to get Ruby 2.2.
apt-add-repository ppa:brightbox/ruby-ng
apt-get update
apt-get install ruby2.2
Here is how to get Ruby 2.3.
apt-get install ruby2.3 ruby2.3-dev
Info on brightbox's maintainance of these.
Using sudo apt-get install ruby-full you will get
old version of ruby (1.9) currently existing in Ubuntu repos.
You might want to check installation from source
Download ruby tar from here and then run:
$ tar -xf ruby-X.X.X.tar.gz
$ cd ruby-X.X.X
$ ./configure
$ make
$ sudo make install
In some cases you will need to realod bash by typing:
$ bash
It depends on what Ubuntu version you are running, you can get the ruby packages with this link http://packages.ubuntu.com/search?keywords=ruby1.9.1&searchon=names&suite=all&section=all, to get the latest Ruby(1.9.2-p290) installed, you have to upgrade your Ubuntu to oneiric, if you don't like to upgrade your system, maybe you have to install Ruby with RVM as fl00r answered.
I might came late but this is a very useful website that provides Ubuntu packages and it seems to be maintained and up-to-date. Look here.
You should check stackoverflow more carefully before asking questions.
Installing Ruby 1.9.1 on Ubuntu?
sudo apt-get install ruby1.9.1-full

Resources