Thursday, August 28, 2014

Tuesday, August 26, 2014

Compass error for command 'grunt server' with angularjs

I am trying to run "grunt serve" for start server but getting this error and my server shutdown due to this:

Error:

sachin@sachin-Lenovo:~/sachin/test$ grunt serve
Running "serve" task

Running "clean:server" (clean) task

Running "concurrent:server" (concurrent) task
    Warning: Running "compass:server" (compass) task
    Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass Use --force to continue.
    
    Aborted due to warnings.
    
    
    Execution Time (2014-08-26 13:21:21 UTC)
    loading tasks    6ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 35%
    compass:server  11ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 65%
    Total 17ms Use --force to continue.
        
        Aborted due to warnings.


Solution:

Use this command for solve this warning:
npm install -g compass
gem install compass -v 0.12.3

Saturday, August 09, 2014

How to install postgresql 9.3 in Ubuntu 14.04

Postgresql is very useful with ruby on rails to reduce complexity.

You can open terminal with "Ctrl + Alt + T" and run this command for install postgresql:

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - 
sudo apt-get update
sudo apt-get install postgresql-common 
sudo apt-get install postgresql-9.3 libpq-dev

For login into postgresql
sudo -u postgres psql
If you want to create user named "sachin" then use this:
sudo -u postgres createuser sachin -s
For change password with user:
sudo -u postgres psql
postgres=# \password sachin

Friday, August 08, 2014

Setup Ruby on Rails with ruby 2 and rails 4 into ubuntu 14.04

Ruby Installation:

sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties

Then you can install via RVM with following few commands:

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc

Then reload your shell or open new terminal window for get changes.

Check that rvm is installed or not:

$ type rvm | head -1
output: rvm is a function


Install ruby 2.0.0 version:
rvm install 2.0.0

If you want to change version then change new version with 2.0.0

rvm use ruby-2.0.0-p481 --default

then check for ruby version:

ruby -v

Rails Installation:

Since Rails have so many dependencies these days, 
Here is a install of Javascript runtime like NodeJS. 

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
gem install rails

If you want to choose specific version then install via this command:

gem install rails -v 4.0.0