Monday, May 20, 2013

Error: Cannot find module 'npmlog'


1. npm install -g yo grunt-cli bower gives the error:

Fix : sudo curl https://npmjs.org/install.sh | sh

How to upgrade Node.js


1. Check the version :  $node --version
   output will be like : n@0.9.3 /usr/lib/node_modules/n

2. To upgrade, run : $n 0.9.3
where, 0.9.3 is from the output of step 1.

Open a new terminal and type: $node --version
You should see the upgraded version.
   

Friday, May 17, 2013

SQLite3::BusyException: database is locked: ROLLBACK TO SAVEPOINT active_record_1

Caused SQLite3 to lock due to bug in a test. To fix:

1. ps -a | grep ruby
2. kill -s 9 12345

12345 is the process id that is the zombie rspec process.

Tuesday, May 14, 2013

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.0


Copied from https://github.com/sparklemotion/nokogiri/issues/742
Moved gem 'nokogiri' in the Gemfile to the top (just below gem 'rails') then:
brew uninstall libxml2
gem uninstall nokogiri
gem install nokogiri

Monday, May 13, 2013

AbstractController::ActionNotFound:


       Could not find devise mapping for path "/users/sign_in?user%5Bemail%5D=bparanj%40gmail.com&user%5Bpassword%5D=secret".
       This may happen for two reasons:
     
       1) You forgot to wrap your route inside the scope block. For example:
     
         devise_scope :user do
           get "/some/route" => "some_devise_controller"
         end
     
       2) You are testing a Devise controller bypassing the router.
          If so, you can explicitly tell Devise which mapping to use:
     
          @request.env["devise.mapping"] = Devise.mappings[:user]

Solution:


  before :each do
    request.env['devise.mapping'] = Devise.mappings[:user]
  end

Thursday, May 02, 2013

How to select the non highlighted button in the popup window on Mac OS

Go to Preferences -> Keyboard. At the bottom, turn on "All controls" under "Full Keyboard Access". Hit space to activate the secondary button.

Wednesday, May 01, 2013

GitHub Error – You don’t exist, go away!

At the terminal run:

dscacheutil -flushcache

How to checkout a specific tag from a Git repo


git checkout tag-name

Friday, April 26, 2013

How to Setup Development Environment to Contribute to Rails

Use the Rails Dev Box available at : https://github.com/rails/rails-dev-box