• Learn how to Run Mac Snow-Leopard on Ubuntu using Oracle Sun Virtual-box
  • Are you a Turbo C++ addict/? Learn how to emulate Turbo c++ with Dos-box in a few steps.
  • Ubuntu's purple love-- A Clean and minimalistic wallpaper for your Desktop.

Compass.app on Ubuntu for free


I've been using SASS and Compass for close to a year now, SASS particularly with compass, is great for CSS authoring. Some of its key features like nested selectors, variables, mixins and functions are now invaluable to me.

Installing and using SASS and Compass is fairly simple and easy on Ubuntu or any other OS for that matter, but since its a command line application it has to be used from the terminal. Using it from the terminal is fine and most of the time we just need to use the compass -watch command to auto detect changes and compile sass files to css. But its always nice to have a nice and clean GUI app that can do all the work for you.

Compass.app is a front-end for Compass, and is written in Java(Jruby) so it can run on Linux, Mac and Windows. The app itself is not free for download, but since the developers have made it open-source you can legally compile your own copy by downloading the source from their git repo.

Here's how I compiled my copy of Compass.app

Make sure you have the official JDK or open-jdk installed before you proceed any further.
sudo apt-get install openjdk-6-jdk
or
sudo apt-get install openjdk-7-jdk

Download the latest copy of Jruby from here

and extract it to your home folder then rename the folder to .jruby

Open terminal(Ctrl+Alt+t) and enter the below command to add jruby to system path.
echo PATH=\$PATH:\$HOME/.jruby/bin >> .bashrc

Open a new terminal and run the below command to install rawr package manager
jruby -S gem install rawr --source http://gems.neurogami.com

Clone the Compass.app source from github
git clone git://github.com/handlino/CompassApp.git "CompassApp"
or if you don't have git installed use the below command to install it.
sudo apt-get install git

Change Directory to CompassApp folder
cd CompassApp

Finally compile CompassApp
jruby -S rake rawr:bundle:all

Once the compilation is finished you should have the compiled app inside CompaassApp/packages/linux run the run.sh file to start the app.

















Update:  Download and run this script inside the folder CompaassApp/packages/linux. The script will move compass.app folder to your home and create a .desktop shortcut for accessing compass from your unity dash.











12 comments:

hlb said...

Would you like to add a wiki page, or update the "Install" section for us? :-)

https://github.com/handlino/CompassApp/blob/master/README.markdown

Srinivas Gowda said...

oh I'd love to! I'll fork the repo and send a pull request.

Erdiawan Anna said...

Please help, i get this error :(

no such file to load -- compile_version
org/jruby/RubyKernel.java:1062:in `require'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/app.rb:2:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/app.rb:77:in `app_require_lib'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/main.rb:103:in `init_app'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/main.rb:13:in `init'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/main.rb:130:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/erdi/CompassApp-master/package/compass.app/compass-app.jar!/main.rb:1:in `(root)'

Srinivas Gowda said...

I'd need some more information before I can tell you what went wrong.At which step did you get the error?

chichibek said...

same error it ocurre when i try sh run.sh

no such file to load -- compile_version
org/jruby/RubyKernel.java:1062:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/app.rb:2:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/app.rb:77:in `app_require_lib'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:103:in `init_app'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:13:in `init'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:130:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:1:in `(root)'
uninitialized constant Tray::App
org/jruby/RubyModule.java:2647:in `const_missing'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/ui/tray.rb:11:in `initialize'
file:/home/a123/CompassApp/packages/linux/compass.app/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.8/singleton.rb:109:in `instance'
file:/home/a123/CompassApp/packages/linux/compass.app/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.8/singleton.rb:107:in `instance'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:115:in `run_tray'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:131:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/a123/CompassApp/packages/linux/compass.app/compass-app.jar!/main.rb:1:in `(root)'

Thomas said...

Same here ubuntu 13.10

Pierre Manceaux said...

Guys, I had the same problem as you. I fixed it (ubuntu, 13.04) simply by installing jruby like this :

sudo apt-get install jruby

After that, you can compile again, and it will normally work. Please note that I have followed the all the steps before, an I did'nt clean jruby before to reinstall it with aptitude.

Good luck.

jg said...

How to you run the script to create the icon? Please help :(

Unknown said...

I am getting the same error as some of the people above:

no such file to load -- compile_version
org/jruby/RubyKernel.java:1062:in `require'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/app.rb:2:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/require_patch.rb:6:in `require'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/app.rb:77:in `app_require_lib'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/main.rb:104:in `init_app'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/main.rb:13:in `init'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/main.rb:131:in `(root)'
org/jruby/RubyKernel.java:1062:in `require'
file:/home/ethan/CompassApp/package/compass.app/compass-app.jar!/main.rb:1:in `(root)'

I am running 13.04 and installed version 1.7.4 of jruby, and before that had already installed ruby 1.9.3 using this method: http://leonard.io/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/

I also tried installing jruby via apt-get, but couldn't get it to compile at all..
Any ideas?

Kibria said...

The method I used to get this working is to download and install RVM, then 'rvm install jruby'. After that, '/bin/bash --login' (this line I don't know why I had to be logged in but worked for me and got rid of the Java errors I had), rvm use jruby-1.x-x, then resume steps from gem install rawr etc.

ashiqul mostofa said...

I cant run the run.sh

the errors are

Exception in thread "main" org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- main
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1085)
at RUBY.require(file:/home/cacophonix/CompassApp/packages/linux/compass.app/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55)
at RUBY.(root)(:1)

laarson johnson said...

Same errors here tried with rvm same shit. what jruby + ruby + rawr config should work here?

Post a Comment