Tuesday, May 19, 2015

Installing Bitnami Ruby Stack as root on Ubuntu 14.04

I have installed Bitnami Ruby Stack 2.2.2-0 Dev (64bit) as root user on my XUbuntu.

In order to make its installation simple, I removed previously installed PostgresSQL, MySQL, Nginx, and Apache servers from my machine. (I did not bother removing Ruby because previously installed version in this machine was 1.9x, and it should have no conflict with Ruby 2.2.x that is to be installed with this version of Ruby Stack.)

1. Resources

2. My environment

I use a 64-bit Ubuntu 14.04 (XUbuntu) machine (Core i3) for this installation.


3. Download

I downloaded Ruby Stack 2.2.2-0 Dev (64-bit) from this site:



The file was downloaded as bitnami-rubystack-2.2.2-0-dev-linux-x64-installer.run in my \Download\ directory.


4. Installation

Because I wanted to install as a root, not as a regular user, I did not run the installer by double clicking. I used the terminal window to run as a root user.

$ cd Downloads
$ sudo ./bitnami-rubystack-2.2.2-0-dev-linux-x64-installer.run

It opened a graphical installation wizard within a several seconds.



I accepted the default installation directory: /opt/rubystack-2.2.2-0/
(Note: the default directory will be different if you run the installer as a regular user, not root user).

When prompted, I entered passwords for MySQL and PostgreSQL servers.

I also selected SQLite as default data source for a sample Rails app installed.


That was all I needed to supply in order to install the RubyStack, which contained a fairly complete set of tools to run ruby/rails applications. In addition to Ruby it self (version 2.2.2p95) , it can optionally install the following items, which I accepted all.





What's interesting is that it can optionally install a bunch of php stuff, which may be convenient if I want to use phpMyAdmin and/or phpPgAdmin to manage my MySQL/PostgreSQL servers. It also gives me an environment in which I can run both ruby and php applications.


5. Test-Run

At the end of installation process, it asked me if I want to run it. I said yes. And here is the result screen (default page at http://localhost).



I clicked the link to run its sample Rails app.




6. Launch Ruby Stack Manager

The Ruby Stack Manager is a desktop application you can use to manually start/stop servers.

$ sudo /opt/rubystack-2.2.2-0/manager-linux-x64.run




7. Starting Servers Automatically At Start up

This installer for Linxu did not setup servers to start automatically. So I had to make some changes to do just that.

I found a simple instruction at http://stackoverflow.com/questions/22037222/how-to-start-bitnami-rubystack-environment-on-linux:

$ sudo -i
# cd /etc/init.d
# ln -s /opt/rubystack-2.2.2-0/ctlscript.sh bitnami-rubystack
# chmod +x bitnami-rubystack
# update-rc.d bitnami-rubystack defaults
# update-rc.d bitnami-rubystack enable
# exit
$

Now restart Ubuntu and check if its servers automatically start.

Check its webserver:
http://localhost


Check its MySQL server:
http://localhost/phpmyadmin
Check its PostgreSQL server:
http://localhost/phppgadmin



8. Set up Environment Variable PATH

Finally, I set up environment variable PATH so that newly installed Ruby and related tools are readily available on my command line.

Open rubyconsole file:
$ leafpad /opt/rubystack-2.2.2-0/rubyconsole
And copy the line that begins with PATH="/opt/rubystack-2.2.2-0/...."
Then paste it on .bashrc file.
export PATH="/opt/rubystack-2.2.2-0/...$PATH"
Restart the terminal and test Ruby on command line.
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
$ rails -v
Rails 4.2.0
$ irb
irb(main):001:0> 1+2
=> 3
irb(main):002:0> exit

Sunday, February 8, 2015

Installing Geany on Mint 17

I installed Geany on Mint 17. Geany is a small text-editor/IDE.

RESOURCES

INSTALLATION

  1. Open Synaptic Package Manager
  2. Search for "geany" and install it

TEST

 $
 $ geany

Sunday, February 1, 2015

Installing Ruby on Mint 17, Using Ruby-install

I installed Ruby (2.1.3 and 2.2.0), using ruby-install on my Mint 17.

1. Resources

2. Installation of ruby-install

$ wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
$ tar -xzvf ruby-install-0.5.0.tar.gz
$ cd ruby-install-0.5.0/
$ sudo make install

3. Testing ruby-install

$ ruby-install --version
ruby-install: 0.5.0

$ ruby-install  # display supported rubies
Latest ruby versions:
  ruby:
    1.9.3-p547
    2.0.0-p576
    2.1.3
  jruby:
    1.7.16
  rbx:
    2.2.10
  maglev:
    1.0.0
  mruby:
    1.0.0

$ ruby-install --help
usage: ruby-install [OPTIONS] [RUBY [VERSION] [-- CONFIGURE_OPTS ...]]

Options:
 -r, --rubies-dir DIR Directory that contains other installed Rubies
 -i, --install-dir DIR Directory to install Ruby into
     --prefix DIR        Alias for -i DIR
     --system  Alias for -i /usr/local
 -s, --src-dir DIR Directory to download source-code into
 -c, --cleanup  Remove archive and unpacked source-code after installation
 -j, --jobs JOBS  Number of jobs to run in parallel when compiling
 -p, --patch FILE Patch to apply to the Ruby source-code
 -M, --mirror URL Alternate mirror to download the Ruby archive from
 -u, --url URL  Alternate URL to download the Ruby archive from
 -m, --md5 MD5  MD5 checksum of the Ruby archive
     --sha1 SHA1  SHA1 checksum of the Ruby archive
     --sha256 SHA256 SHA256 checksum of the Ruby archive
     --sha512 SHA512 SHA512 checksum of the Ruby archive
 --no-download  Use the previously downloaded Ruby archive
 --no-verify  Do not verify the downloaded Ruby archive
 --no-extract  Do not re-extract the downloaded Ruby archive
 --no-install-deps Do not install build dependencies before installing Ruby
 --no-reinstall   Skip installation if another Ruby is detected in same location
 -V, --version  Prints the version
 -h, --help  Prints this message

Examples:
 $ ruby-install ruby
 $ ruby-install ruby 2.0
 $ ruby-install ruby 2.0.0-p0
 $ ruby-install ruby -- --with-openssl-dir=...
 $ ruby-install -M https://ftp.ruby-lang.org/pub/ruby ruby
 $ ruby-install -M http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby ruby
 $ ruby-install -p https://raw.github.com/gist/4136373/falcon-gc.diff ruby 1.9.3

4. Install Latest Stable version of Ruby, using ruby-install

$ ruby-install ruby
>>> Installing ruby 2.1.3 into /home/(user)/.rubies/ruby-2.1.3 ...
>>> Installing dependencies for ruby 2.1.3 ...
.
.
>>> Successfully installed ruby 2.1.3 into /home/socrateos/.rubies/ruby-2.1.3
$ cd ~/.rubies/ruby-2.1.3/bin
$ ./ruby --version
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux] 

5. Install Latest version of Ruby (2.2.0), using ruby-install


$ ruby-install ruby 2.2.0
>>> Installing ruby 2.2.0 into /home/socrateos/.rubies/ruby-2.2.0 ...
>>> Installing dependencies for ruby 2.2.0 ...
.
.
>>> Successfully installed ruby 2.2.0 into /home/socrateos/.rubies/ruby-2.2.0
$ cd ~/.rubies/ruby-2.2.0/bin
$ ./ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]

5. Change PATH environment variable


$ gedit ~/.profile
export PATH="$PATH:$HOME/.rubies/ruby-2.2.0/bin/"

Relogin and check.


$ ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ irb
irb(main):001:0> RUBY_VERSION
=> "2.2.0"

Installing Amazon Kindle Reader on Mint 17

1. Resources

2. Preparation

Since there is no native Kindle application for Linux, you have to install Wine/PlayOnLinux first. See my installation notes: Installing PlayOnLinux on Mint 17

3. Install Amazon Kindle Reader for PC

Download installer file:

$ cd ~/Downloads
$ wget http://kindleforpc.amazon.com/40514/KindleForPC-installer.exe

Open PlayOnLinux and Click "+ Install" button.

Wait for some updates. It took for several minutes for me. It will open a "Wizard" screen to lead the installation step by step.

First, search for "Amaz". When found, select "Amazon Kindle" from the list box and click "Install" button.

Next, select "Use a set-up file on my computer" in the list and click "Next" button.

When prompted, select the installer file (KindleForPC-installer.exe) you downloaded earlier. Then click "Next" button.

When the installation is complete, it will open a familiar Kindle screen.

4. Run Amazon Kindle Reader

Launch "PlayOnLinux". Select "Amazon Kindle" from the list and click "Run". It will open Kindle reader.

5. Notes

  • When I clicked "+ Install" button for the first time, it did a lengthy update, including (looks like) re-installing of Wine 1.6.2. before the Wizard window appeared on screen.
  • Installer wizard does not close until you quit the Kindle Application it opened at the end of installation process.

Saturday, January 31, 2015

Installing PlayOnLinux on Mint 17

I installed PlayOnLinux on Mint 17. It is a software (GUI for Wine) that allows to run Windows applications on Linux.

The reason is mainly that I wanted to read (on my Mint box) Kindle e-books that I have already purchased over the years. Generally I use my (non-kindle) tablet to read e-books, but some of books are about Ruby programming and I want to read them on my Mint box while doing some programming. From now on, I am going to avoid buying Kindle books unless it is absolutely necessary.

1. Resources

2. Installation

  1. Open Synaptic Package Manager.
  2. Search for and install "playonlinux".
It installed following packages, including Wine itself (1.6).

curl (7.35.0-1ubuntu2.3)
icoutils (0.31.0-2)
imagemagick (8:6.7.7.10-6ubuntu3)
imagemagick-common (8:6.7.7.10-6ubuntu3)
libencode-locale-perl (1.03-1)
libfile-listing-perl (6.04-1)
libhtml-parser-perl (3.71-1build1)
libhtml-tagset-perl (3.20-2)
libhtml-tree-perl (5.03-1)
libhttp-cookies-perl (6.00-2)
libhttp-date-perl (6.02-1)
libhttp-message-perl (6.06-1)
libhttp-negotiate-perl (6.00-2)
libio-html-perl (1.00-1)
liblcms2-2:i386 (2.5-0ubuntu4)
liblqr-1-0 (0.4.1-2ubuntu1)
liblwp-mediatypes-perl (6.02-1)
liblwp-protocol-https-perl (6.04-2ubuntu0.1)
libmagickcore5 (8:6.7.7.10-6ubuntu3)
libmagickwand5 (8:6.7.7.10-6ubuntu3)
libnet-http-perl (6.06-1)
libwww-perl (6.05-2)
libwww-robotrules-perl (6.01-1)
libwxbase2.8-0 (2.8.12.1+dfsg-2ubuntu2)
libwxgtk-media2.8-0 (2.8.12.1+dfsg-2ubuntu2)
libwxgtk2.8-0 (2.8.12.1+dfsg-2ubuntu2)
ocl-icd-libopencl1 (2.1.3-4)
ocl-icd-libopencl1:i386 (2.1.3-4)
p7zip-full (9.20.1~dfsg.1-4)
playonlinux (4.2.2-1)
python-wxgtk2.8 (2.8.12.1+dfsg-2ubuntu2)
python-wxversion (2.8.12.1+dfsg-2ubuntu2)
wine (1:1.6.2-0ubuntu4)
wine1.6 (1:1.6.2-0ubuntu4)
wine1.6-amd64 (1:1.6.2-0ubuntu4)
wine1.6-i386:i386 (1:1.6.2-0ubuntu4)

The installer created a new menu group "Wine". But it did not create menu item for PlayOnLinux. So I added a new menu item for "PlayOnLinux" and placed under "Wine" menu group.

3. Test

First, I opened "Notepad" from the Wine menu.

Before opening Note window, it found missing a couple packages and automatically installed them though it failed once during the installation. I just kept clicking "Install" button and it finally opened Notepad window.

Then, I clicked "Browse C: Drive" from the Wine menu. It showed the following window.

Finally, I clicked "PlayOnLinux" menu item I have created to open "PlayOnLinux".

It seems that Wine/PlayInLinux is playing fine.

4. Notes

Even though I read instructions in the PlayInLinux home page's download page, I did not follow. It warns: "Ubuntu Precise (and superior) users : You must install the package wine:i386 to get PlayOnLinux working".

I searched for an instruction for Mint 17 because of this warning but did not find any. So I decided to use Synaptic Package Manager to install because it automatically finds and shows all related packages that are required. Yes, it did install "wine1.6-i386:i386 (1:1.6.2-0ubuntu4)"

Friday, January 30, 2015

Installing git on Mint 17

1. References

2. Pre-installation

$ git --version
The program 'git' is currently not installed. You can install it by typing:
sudo apt-get install git

3. Installation

$ sudo apt-get install git
.
.
The following NEW packages will be installed
  git git-man liberror-perl
.
.
Setting up liberror-perl (0.17-1.1) ...
Setting up git-man (1:1.9.1-1ubuntu0.1) ...
Setting up git (1:1.9.1-1ubuntu0.1) ...
$ git --version
git version 1.9.1

4. Configuration

$ git config --global user.name "myname"
$ git config --global user.email "myname@myhost.com"
$ git config --global color.ui auto # colorize command line

Sunday, January 4, 2015

Installing Sublime Text 3 on Mint 17

I have installed Sublime Text 3 on Mint 17.

1. Resources

Sublime Home Page: http://www.sublimetext.com/

2. Installation

I installed it using Synaptic Package Manager since it had a latest version (build 3065). See Download site for to confirm latest version: http://www.sublimetext.com/3

a. Open Synaptic Package Manager.
b. Search and install "sublime-text".
c. After installation, the sublime-text appears in the Programming menu.

Installing Bitnami Ruby Stack on Mint 17

I have installed Bitnami Ruby Stack on my Mint 17. Bitnami Ruby Stack is a complete ruby development environment that includes Ruby, Rails, SQLite, MySQL, PostgreSql, Apache, Nginx (for Linux), Git, Subversion, RVM, PHP, Node.js, etc. This is one of the easiest single click installation methods for ruby development environment.

1. Sources

Bitnami Ruby Stack Isntaller download site: https://bitnami.com/stack/ruby/installer

2. Download

I downloaded "Ruby Stack 2.1.5-1 Dev (64-bit)" from https://bitnami.com/stack/ruby/installer

3. Installation

a. First make the downloaded file (bitnami-rubystack-2.1.5-1-dev-linux-x64-installer.run) executable.

(1) Right click on the downloaded file and open its Properties window.
(2) Goto Permission tab and turn on Executable check box.

b. Now execute the file to install.

(1) Double click to execute the installation file. (You have to wait for several seconds before seeing welcome screen.)
(2) I selected all features that include:

(3) I made a change to the destination: home/socrateos/rubystack/rubystack-2.1.5-1 (instead of suggested home/socrateos/rubystack-2.1.5-1) so that I may be able to install future version(s) in the same common directory "rubystack".

(4) Server manager shows initial servers that are running.

3. Create Short cuts

I have created desktop short cuts for the following files:

a. manager-linux-x64.run - to launch server manager (stop & start web and db servers)

b. rubyconsole - to launch terminal with all ruby path set up temporarily. Bitnami ruby does not interfere with normally installed ruby.

(1) Test ruby console. Double click to open the Ruby console
(2) Run a ruby command:

$ ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]