Wednesday, 30 May 2012

New Relic development mode

Further to my previous post on , the for applications gives you an awesome development mode and stats view for free.
Just add the gem to your application, install and restart, and visit the path /newrelic to see it.

Once again, Newrelic is awesome :)

Wednesday, 23 May 2012

Rice is Nice for Jasmine On Rails

Test first seems topical. Let me explain a little about how we do it here at Hedtek...

For , we run . To and JavaScript, we use . For on , we use to push Jasmine into the testing asset pipeline. Last week, we took a look around for a smooth way to integrate this continuously, and settled happily on .

When I see an open source project with a handful of documentation, a question springs to mind: can it really be this easy?

With jasminerice-runner, it is.

Just

#= require jasminerice_reporter

rake jasminerice:run

Good stuff, gaslight.

Thursday, 10 May 2012

First Time Heroku, Precompiling Assets

provides in the , and is well known as a host for apps. Last week, my first opportunity arrived to find out whether Heroku is as good as they say. I wasn't disappointed.

Following the documentation, everything progressed smoothly: signing up, installing Heroku Toolbelt, initial login, creating the cedar stack and the final push — except asset compilation. By default, Heroku continues even if asset compilation fails. So always read the output carefully:

$ git push heroku master
...
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.2
...
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       could not connect to server: Connection refused
       Is the server running on host "127.0.0.1" and accepting
       TCP/IP connections on port 5432?
       
       Tasks: TOP => environment
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting
-----> Rails plugin injection
...

One simple way around an asset compilation issue is to:

  1. Compile locally
    $ bundle exec rake assets:precompile
    
  2. Commit assets to git
    $ git add -f public/assets/
    $ git commit -m "Precompile public assets"
    
  3. Push
    $ git push -f heroku master
    

And — after heroku run rake db:migrate — everything's great

-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Detected manifest.yml, assuming assets were compiled locally
-----> Rails plugin injection

or at least for me...

Friday, 4 May 2012

Newrelic

is awesome, simple and really easy server and application monitoring. Application monitoring is cool, and server monitoring cool and free.

How much more awesome do you need? Maybe a really easy setup to get the server monitoring on all your nodes?

Then just add your newrelic key to each node to be monitored under node[:newrelic][:license_key]