Thursday, August 29, 2013

Setting the IFrame height dynamically

Awesome HTML5 feature that helps to set the IFrame height dynamically.

Use the following script

<script type="text/javascript" >
$(document).ready(function(){
    window.setInterval(resizeParentIframe, 2000);
 });

var pastHeight = 0;

function resizeParentIframe() {
var currentHeight = document.body.scrollHeight;
if (currentHeight != pastHeight){
pastHeight = currentHeight;
parent.postMessage(document.body.scrollHeight, '*');
}
}
</script>

Wednesday, August 28, 2013

ERROR: Error installing rails: activesupport requires Ruby version >= 1.9.3.

Check whether you are trying to install the correct version of Rails that are compatible with your Ruby Version.

You can check the ruby version by running the cmd "ruby -v"

Rails VersionPossible Ruby VersionsRecommended Ruby Version
1.0–2.11.8.61.8.6
2.21.8.6 or 1.8.71.8.7
2.31.8.6, 1.8.7, or 1.9.11.8.7
3.0–3.21.8.7, 1.9.2, or 1.9.31.9.3
4.0–…1.9.3, 2.0.x2.0.x

then try to install the rails

sudo gem install rails --version 3.2.12

Sunday, August 4, 2013

brew: command not found

If HomeBrew is not installed, Please follow the instruction mentioned here

1. Install XCode, check whether command line tools are installed or not.

2. $ gcc --version

3. It will display "i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

4. Then you can execute the following command to install the home brew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

5. It will display "You should run `brew doctor' *before* you install anything." as last sentence after installing the home brew

6. Now type "$ brew doctor" .

7. Before implementing the recommendation, make sure whether it correct or not.

8. Finally, $brew update. That's it.

Reference : http://ricardianambivalence.com/2012/10/02/install-homebrew-on-your-mac-a-tutorial/

Install RVM Error

Can not find compiler and 'make' tool - make sure Xcode and/or Command Line Tools are installed.


1. Check whether you have install Xcode and its command line tools.

2. After installing the XCode, click on Xcode -> Preferences -> downloads

3. Check whether "Command Line Tools" got installed or not.