Skip to main content

Posts

Showing posts from September, 2015

Git branch and basic commands and rails3 to rails4

Rails 3 to Rails 4 Migrations


Ruby Version 2.2.2 Rails Version 4.2.3 Modification files
1)Gemfile Latest Gems related versions 2)Routes Change the match method with via get or post 3)Controllers New params creating and updating the data. i)params.require(:person).permit(:name, :age)
4)Models Active Record queries need to change i)Profile.where(“code is not null”) Profile.where.not(code: null) ii)Write the scopes in Models 5)Javascripts,stylesheets,images_paths Move the javascriptfiles and stylesheets to assets folder 6)Facebook,Linkedin,Twitter apis need to change Code changes Latest versions of the API



Git Related Commands
git branch List of branches for the git git chekout -b newbranchname(Like rails4_migration) Creating the new branch git checkout branchname(Like rails4_migration) Switching branche one branch to another branch git fetch It will pull the all branches in git

Gem::LoadError (Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).?

Gem::LoadError (Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).) In rails?


1)change the gemfile in mysql version
 gem 'mysql2'

2)Change to mysql2 version
 gem 'mysql2','0.3.20'