Monday, February 16, 2015

create a new rails 5 application and deploy to heroku

how to create a new rails 5 application and deploy it into heroku.
install ruby and rails following by their dependencies.

user@ubuntu-15.04:~$ ruby -v
ruby 2.2.0p0 (2015-01-25 revision 49005) [x86_64-linux]
user@ubuntu-15.04:~$ rails -v
Rails 4.2.0

install edge rails
user@ubuntu-15.04:~$ git clone git@github.com:rails/rails.git ~/packages/edge/rails
user@ubuntu-15.04:~$ export EDGE=/home/user/packages/edge/rails/railties/bin
user@ubuntu-15.04:~$ $EDGE/rails -v
Rails 5.0.0.alpha
user@ubuntu-15.04:~$ $EDGE/rails new --edge --database=postgresql rails-5-demo-blog
user@ubuntu-15.04:~$ cd rails-5-demo-blog


user@ubuntu-15.04:~/rails-5-demo-blog$ git init; git add . ; git commit -m "first commit"
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails g --help
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails g scaffold Post name desc:text at:timestamp
user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:create; rake db:migrate;


user@ubuntu-15.04:~/rails-5-demo-blog$ git add . ; git commit -m "Post Scaffold Added"
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails s

now ,you can browse at localhost:3000

want to run in production

comment this last 2 line in config/database.yml

# username: rails-5-demo-blog
# password: <%= ENV['RAILS_5_DEMO_BLOG_DATABASE_PASSWORD'] %>

add production secret_key into config/secret.yml at last line
<pre>
production:
  secret_key_base: blahblahblah
</pre>
add <pre>root 'posts#index'</pre> into config/routes.rb
add </pre>public/assets/</pre> into .gitignore

user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:create RAILS_ENV=production
user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:migrate RAILS_ENV=production
user@ubuntu-15.04:~/rails-5-demo-blog$ rake assets:precompile
user@ubuntu-15.04:~/rails-5-demo-blog$ RAILS_SERVE_STATIC_FILES=true $EDGE/rails server -e production

now, you can browse your production app at localhost:3000

deploy to heroku

add <pre>ruby '2.2.0'</pre> at top of Gemfile
add <pre>gem 'rails_12factor', group: :production</pre> into Gemfile

user@ubuntu-15.04:~/rails-5-demo-blog$ bundle
user@ubuntu-15.04:~/rails5blog$ git add .;git commit -m "Heroku dependencies Added"


install heroku toolbelt

user@ubuntu-15.04:~/rails-5-demo-blog$ heroku login
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku create
user@ubuntu-15.04:~/rails-5-demo-blog$ git push heroku master
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku run:detached rake db:migrate
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku open

A demo app created at https://github.com/thaniyarasu/rails-5-demo-blog
this demo app deployed into heroku at https://rails-5-demo-blog.herokuapp.com/


Dartium will kill all major web & desktop application in upcoming years


After analyzing All Web Technologies,
i am sure about that , DARTIUM  (dartlang.org) will kill All Mobile & Desktop Application in another 3-7 years.

The Effect of Dartium


1) Dartium will dominate javascript in upcoming years
2) Dartium will kill All Desktop Apps 
3) Dartium will kill All Mobile Native Apps like Android ,IPhone,BlackBerry , Windows Mobile,etc

Go Language , Dart Language, Dartium ,PolymerDart ,AngularDart, Pnacl/NacL are the Future of Web Technologies.

All server side component will be re written in Golang
All client side component will be re written in AngularDart with the support of dartlang and polymerDart


Monday, February 9, 2015

remove homebrew complete in mac

~$ sudo rm -rf /usr/local
~$ sudo mkdir /usr/local
~$ sudo chown -R 777 /usr/local
install homebrew

~$ sudo chown -R $USER /Library/Caches/Homebrew
~$ brew install automake libtool pkg-config gcc48 libyaml readline libksba openssl
install rvm
rvm requirements