Need help with clementine?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

128 Stars 20 Forks MIT License 37 Commits 7 Opened issues


Gem for ClojureScript on Rails Asset Pipeline

Services available


Need anything else?

Contributors list

# 41,825
23 commits
# 10,377
7 commits




Clementine is a gem to use ClojureScript ( from Ruby. Clementine is a Tilt ( Template, which is available to use on Rails asset pipeline. Also, it is avilable to use in a Tilt way. You don't need to compile ClojureScript by yourself anymore. Clementine does for you.

Clementine runs on Rails 3.1 and later.

Clementine supports JRuby and CRuby. When you use from CRuby, make sure java command is on your PATH.

Please be aware. When you run Clementine on CRuby, you hook up JVM everytime ClojureScript code is changed. This takes long time since starting JVM is a heavy weight job. For a shorter compilation time, I recommend using JRuby.


gem install clementine

While installing this gem, you'll see a confusing phrase, "Installing clementine (version string) with native extensions." This means clementine is bootstrapping ClojureScript. Clementine never relies on any C library.


Create clementine.rb file in your ${Rails.root}/config/initializer directory.


Clementine.options[:optimizations] = :whitespace
Clementine.options[:pretty_print] = true

Available options:

  KEY                VALUES                  DEFAULT
  ------------------ ----------------------- -------------------
  :optimizations     :whitespace, :advanced  :advanced
  :pretty_print      false, true             false
  :target            :nodejs                 (none)
  :output_dir        directory name          (none)
  :output_to         file name               (none)

If you want to see a readable JavaScript code on the browser, set :whitespace for :optimazations and true for :pretty_print in ${Rails.root}/config/initializer/clementine.rb like the example above.

ClojureScript has :none value for :optimizations, which also works with Clementine. However, there's no way to see the output with Rails asset pipeline. So, I didn't add :none in the above table.

Copyright and License

Clementine is Copyright (c) 2011-2012 Yoko Harada and distributed under the MIT license.

Clojure and ClojureSript are Copyright (c) Rich Hickey and covered by the Eclipse Public License 1.0

Google Closure Compiler and Library are covered by Apache License 2.0.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.