Skip to main content

Posts

Rake not found in any source

Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound) This is a very common issue sometimes and it took me time to figure it out. The passenger configuration present in /etc/apache2/apache2.conf was pointing to different ruby version. Change it accordingly depending on the specific ruby version being used. Steps i performed: $ rvm use  1.9.3p327 $rvm gemset list $rvm gemset create g1 $cd . Now edit the .rvmrc files present in project folder accordingly,  rvm use 1.9.3-p327@g1 From the project folder type $cd . and the ruby version with specific gemset is loaded for the application. You can also do  $  rvm use  1.9.3p327 --default  to make it default. Once more way i fixed this issue is, removed the gemset which i created and used the default gemset that is available. $ rvm gemset use default

No Reboot option while creating image from instance

No reboot option while creating image from instance is used when you don't want to restart the instance while the snapshot is being taken. If that option is checked, aws says the integrity of the file system cannot be guaranteed. By default it takes snapshots of the instance and any attached ebs volumes.

Adding name field for ebs volume

Select the ebs volume and go below, select tags and then add/edit tags. First field is by default Name, enter the value and it's updated. While trying to attach ebs to instance, stop the instance while attaching and detaching. It takes fraction of seconds.

Setting up Ghost-Blogger platform

Ghost blogger platform is very user friendly for creation blogs. Here are the basic steps i used to set it up Download the ghost blog code for a stable release or clone a github repo. https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager ubuntu 13.04 comes shipped with old verion of node.js, so u just need to run $sudo apt-get install nodejs

MongDB 27017 vs 27018

Setting up a MongoDB server on a separate ec2 instance and then accessing it from the application and web interface. The default port used is 27017 by various MongoDB drivers while 28017 is used to handle HTTP requests and provides some general monitoring. In case you are interested to start mongod on a separate port for say security reasons, take it as 6565, then the monitor port will always be 7575. You can also query via web browser, sudo /etc/init.d/mongod --rest . Now simple queries can be executed like http://localhost:7575/database/collection/?filter_a=1 . I often use mongoid to access mongodb in my rails application and access the rails console using rails c production, which links me to the mongo database present on different ec2 instance. Use "connection strings" of the form mongodb://user:pwd@host:port/. Refer  MongoDB - HTTP Interfaces

Ruby 2.0 walkthrough

Ruby 2.0.0 released on 24 feb 2013, marks the 20th anniversay of Ruby. rvm get stable This updates your rvm to the latest stable release. $ rvm install ruby It update system libraries and install ruby, so when i try $ rvm list rvm rubies =* ruby-1.9.3-p286 [ x86_64 ] ruby-2.0.0-p195 [ x86_64 ] # => - current # =* - current && default # * - default Now, install rails using gem install rails --version 4.0.0.beta1 --no-ri --no-rdoc

Sublime is my current home

Iam a sublime user currently, here are some of the shortcuts which i often use Closing a tab- ctrl + w opening the last closed tab - ctrl + shift + t Moving the cursor to a specific line - ctrl + g Opening a file- ctrl + p There's a lot of stuff to go into this from my side, will update when free.. Found this file, which list all the shortcuts nicely.

Adding a local repo to Github

You created a local repo in your m/c and then want to push it to github The github repo for your project has already been created on github. Either you have created it or has been added as one of the collaborators. When you create a project $ rails new app1 --skip-active-record --skip-bundle and want this to be associated to the repo cd to the project folder, $ cd app1 and then execute $git init $ git remote add origin git@github.com:analytics/app1.git then do $git pull origin master $git push So, the local repo has been pushed to the remote github repo

Starting with mongodb

 Create a new rails application for mongo, so let's skip active record as it's not required. rails new appname -- skip - active - record In case if want to skip bundle, append this --skip-bundle whereas if you want to use mysql as default append this -d mysql Use the following rails versions which are release after the security fix,       3.2.11       3.1.10       3.0.19       2.3.15 rails g mongoid:config Checkout for mongoid.yml for db configuration. Check for config/application.rb. it would have the below lines.  # Pick the frameworks you want: # require "active_record/railtie"  require "action_controller/railtie"  require "action_mailer/railtie"  require "active_resource/railtie"  require "sprockets/railtie"  require "rails/test_unit/railtie" Some basic things which can be followed for good practices. Setup RVM Then create a gemset, rvm gemset create a...

Git commands i was unaware of !

Git basics and continued ...! Add all the deleted files using 'git add -u'. This will add all the files in git including the deleted files. If you only want to add deleted files, try: git ls-files --deleted | xargs git commit Once you clone a project, check out the branches present using, git branch -a or git branch -r for remote branches. See the contents of any object using git show Check for the space occupied by object database to git count-objects -v git verify-pack -v .git/objects/pack/pack-*.idx To check if connection to host is established. ssh -vT git@github.com