Montag, 18. März 2013

Installing FX/Ruby on (Kali) Linux

As most of the common linux distribution also Kali Linux has its own ruby package. But using these pre-built packages is often a pain in the ... ahm ... not the best choice, especially if you need to compile your own modules. From my experiences with Ruby on linux, I recommend to use RVM (Ruby Version Manager) for installing Ruby. This little tutorial will show you how to install (FX)Ruby on Kali Linux.

I assume you're using Kali Linux as an unprivileged user (not/never root!). If not, it's not my problem ;)
If running as root you should create an unprivileged user with the following commands:
adduser -m -s /bin/bash -G sudo "your_username"
passwd "your_username" [now enter your super-secure-password]

Now logout 'root' and login as your new user

Note: The following steps are meant to be executed as an unprivileged user!
Otherwise RVM will install itself as a multi-user-environment which will not work for this tutorial.

1. Install Additional Packages

These packages are necessary to compile fox-toolkit, fxscintilla and opengl which are essential for fxruby.
for pkg in bash curl git patch bzip2 build-essential openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev libxft2-dev freeglut3-dev libjpeg-turbo8-dev libjpeg8-dev libjpeg-dev zlib1g-dev libbz2-dev libpng12-dev libtiff4-dev;
do
sudo apt-get -y install $pkg
done
# ftp://ftp.fox-toolkit.org/pub/fox-1.6.47.tar.gz
# Download and compile fox-toolkit
# version 1.6.44 works
# version 1.7.x is incompatible with fxruby
# http://www.fox-toolkit.org/
wget http://ftp.fox-toolkit.org/pub/fox-1.6.47.tar.gz
tar xzvf fox-1.6.47.tar.gz
cd fox-1.6.47
./configure
make
sudo make install
cd ..

# Download and compile fxscintilla
wget http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-2.28.0.tar.gz
tar xzvf fxscintilla-2.28.0.tar.gz
cd fxscintilla-2.28.0
./configure
make
sudo make install
cd ..


Now it's time to lay back and get a coffee ...

2. Install RVM

Installing RVM is very straight forward. More details can be found here.
znow@hotdog:~$curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable
znow@hotdog:~$source "$HOME/.rvm/scripts/rvm"

3. Integrate RVM Into Gnome Terminal

Before we continue with installing Ruby we should make our bash running as a login-shell. If you want to learn more about how to integrate RVM into Gnome, I recommend this article.
So, first check "Run command as login shell" option under Terminal->Edit->Profile Preferences|<-title data-blogger-escaped-and="" data-blogger-escaped-command-="">

Next, we have to edit ~/.bash_profile to make it look like this:
source "$HOME/.profile"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

4. Install Ruby

In case you want to use WATOBO you should install Ruby 1.9.3. No lower version and no higher! Open a new terminal and type:
znow@hotdog:~$rvm install 1.9.3
Now it's time to lay back and get a 2nd coffee ....

Re-check your ruby path which should point into your home directory:
znow@hotdog:~$ which ruby
/home/znow/.rvm/rubies/ruby-1.9.3-p392/bin/ruby

5. Install FXRuby and more ...

Now everything should be fine and you can continue installing gems you like, like fxruby, opengl, ...
znow@hotdog:~$ gem install fxruby
Fetching: fxruby-1.6.26.gem (100%)
Building native extensions. This could take a while...
Successfully installed fxruby-1.6.26
1 gem installed
Installing ri documentation for fxruby-1.6.26...
Installing RDoc documentation for fxruby-1.6.26...
znow@hotdog:~$ ruby -e "require 'fox16'; puts Fox.fxversion"
1.6.47
znow@hotdog:~$

Installer

You can download the installer shell script [here]

[as]

Keine Kommentare:

Kommentar veröffentlichen