Configuring an ubuntu development machine

kej edited this page Aug 22, 2012 · 9 revisions

back to For developers

This will show what to do to get the system up and running as a development version of befchina locally on your computer.

Xubuntu 11.10 x64

Probably also works for other unixoide and is in most of the steps similar to an install on Mac OSX, too. In some steps version numbers and platform (x64) may differ at the time of reading, so have a look at before you c&p

Make Rubymine working

Our preferred IDE

Install Oracle Java JRE

I don't know if RubyMine also works with other javas, but this one seems to make the fewest (can you count them?) problems

Install Rubymine

sudo mkdir /opt/RubyMine
sudo mv ~/Downloads/RubyMine-3.2.4 /opt/RubyMine
  • Try to start Rubymine /opt/RubyMine/RubyMine-3.2.4/bin/rubymine.sh

    • if that gives some JAVA error edit @/etc/environment@ and add the line
RUBYMINE_JDK=/opt/java/64/jre1.6.0_30
might need reboot but until then `export` it
  • Newer versions of Rubymine do it themselves, no need to do this in 2012 Add starter with menu editor or place a .desktop file e.g. /usr/local/share/applications/RubyMine.desktop Newer versions of Rubymine do it themselves, no need to do this in 2012
[Desktop Entry]
Name=RubyMine
Exec=/opt/RubyMine/RubyMine-3.2.4/bin/rubymine.sh
Comment=RubyMine IDE
Icon=/opt/RubyMine/RubyMine-3.2.4/bin/RMlogo.svg
NoDisplay=false
Categories=Development
Type=Application

Install Ruby via RVM

The programming language, with rvm different versions of it can be used and easily installed. Also the gems can be managed in different sets.

bash -s stable < 
  • read + do whats written in the oputput

  • rvm command should now work in shell

  • check

rvm requirements
and probably do
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
  • install stable ruby
rvm install 1.9.3
  • set this ruby as default
rvm use 1.9.3 --default
  • check if it works, should be like
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ which ruby
/home/abc/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
  • create a gemset
rvm gemset create befchina
  • set it default if you want to use it outside of rubymine
rvm gemset use befchina --default

Versioncontrol Git

To access the code

  • install git, git-core
  • GUIs for git include giggle, gitg and gitk
  • all avaible via apt-get

Install PostgreSql Database

  • Database, dev for building of gem native extension and DB-GUI via
sudo apt-get install postgresql postgresql-server-dev-9.1 pgadmin3
# Under Ubuntu 10.04 LTS to be able to install pg gem i had to add
sudo apt-get install libpq-dev
  • create password for database superuser (security doesn't matter as it's only local for development)
$ sudo -u postgres psql
  ...
postgres=# \password postgres
Enter new password: postgres
Enter it again: postgres
postgres=# \q
  • Connect via pgadmin to check if Database is working (Server: localhost, Port: keep (5432), User: postgres, Pass: postgres)

  • Install the PL/pgSQL language to the database

sudo -u postgres createlang plpgsql template1

Install ImageMagick

  • Image Magick is a commandline tool suite for image manipulation
sudo apt-get install imagemagick

Get the code and make things work together

There are some differences to installing a production machine as described in Set up your BEFdata platform, but the basic steps are the same. So go along those steps and keep in mind:

Installing gems

Instead of bundle install on the command line, do it through Rubymine:

  • Open the befchina folder in Rubymine

  • Don't install the missing gems as offered

  • Let it use the created gemset: File > Settings > Ruby SDK and Gems > Select Ruby interpreter: "RVM: ruby-1.9.3-p0 [befchina]"

  • Install gems: Tools > Bundler > Install !! at this point it does not work for me anymore !!

Linking to database

  • Set up the database-connection in @befchina/config/database.yml@ set the @usernames@ and @passwords@ to @postgres@

ImageMagick

  • find out ImageMagick path by running
which convert
  • See if the path in @config/environments/development.rb@ is corresponding to the one of convert
Paperclip.options[:command_path] = "/usr/bin/"

You should be fine!!

Configurations for commiting code

  • install filemerge utility
sudo apt-get install meld

Make the rubymine debugger work with ruby 1.9.3

test if the debugger works, see if you get an error like this http://rubyforge.org/tracker/index.php?func=detail&aid=29222&group_id=8883&atid=34290

by now (2012-1-17) it seems some neccesary gems are not pushed to rubygems in their latest version.

wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install -l linecache19-0.5.13.gem

then update ruby-debug-base19x to 0.11.30.pre6

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.