Debugging Rails 4 CoffeeScript and Sass source files in Google Chrome

These days, it is kind of popular to generate static assets such as JavaScript and CSS by using some preprocessors. For example instead of writing pure Javascript you can use CoffeeScript, TypeScript… Instead of CSS, you can use Sass, Less, Stylus

This article shows how to debug CoffeeScript and Sass in Google Chrome using Rails 4.

Mount S3 into EC2 (micro) instance

This quick howto describes how to mount Amazon Simple Storage (S3) into Amazon Elastic Compute Cloud (EC2) instance. In my case is it micro instance with Basic 64-bit Amazon Linux AMI 2011.09.

MacBook Pro and insert key

When I switched from Linux notebook to MacBook Pro I really missed insert key. I don’t need insert in OS X, but it’s useful for remote work (for example on linux machine). I found on the Internet some tips like fn + enter to emulate insert, but nothing works. I realized I don’t need insert in whole OS X, but only in application used for remote work. In my case it’s iterm2. So here’s quick tip how to emulate insert in iterm2.

Homebrew without Xcode

Xcode 4 is not small. In my case it took about 10GB of free space. I know its not a lot, especially these days when standard notebooks have hard drives with capacity about 0.5TB. But I have small SSD and 10GB is quite a lot for me. And best of all I don’t use Xcode. But I’m using homebrew for unix tools installation and it relies on GCC and other libraries (which are part of Xcode). Fortunately there is a way how to get these libraries without Xcode. So let’s get rid of it.

Standalone Passenger on OS X Lion

After upgrading to Lion I can’t run standalone passenger. It throws following error when I tried to compile it using passenger package-runtime.

** Execute (dry run) nginx
/Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:224:in `*': negative argument (ArgumentError)
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:224:in `show_progress'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:147:in `install!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:423:in `install_passenger_support_files'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:328:in `run_rake_task!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:323:in `popen'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:323:in `run_rake_task!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:422:in `install_passenger_support_files'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:421:in `chdir'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:421:in `install_passenger_support_files'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/runtime_installer.rb:143:in `install!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/abstract_installer.rb:63:in `start'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/package_runtime_command.rb:65:in `run'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:93:in `run_command'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:48:in `each_command'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:43:in `each'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:43:in `each_command'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:91:in `run_command'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:62:in `run!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/lib/phusion_passenger/standalone/main.rb:39:in `run!'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/gems/passenger-3.0.7/bin/passenger:32
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/bin/passenger:19:in `load'
    from /Users/vhyza/.rvm/gems/ruby-1.8.7-p330@dummy/bin/passenger:19

This error is caused (probably) by newer rake. Workaround for this is uninstalling newer version (in my case 0.9.2) and use older 0.8.7. But when I executed passenger package-runtime after that, it throws another error.