firstruby

Master ruby with us

Posts Tagged ‘git’

Rails 3.0.x + Gem installation from git source + Passenger

Posted by firstruby on December 31, 2010

In Rails 3.0.3 application, I have developed login functionality using ‘Authlogic’ gem. Gem added in ‘Gemfile’ as,

gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'

Application was working fine with Mongrel and WEBrick server, but it was throwing an error with Passenger,

git://github.com/odorcicd/authlogic.git (at rails3) is not checked out. Please run `bundle install` (Bundler::GitError)

When we do ‘bundle install’, bundler installs gem (from GIT source) to different path other than regular one. Passenger does not understand this path, and that’s why above error was coming. So I have fixed it in following way,

I have installed ‘authlogic’ as a Plugin from branch “rails3” of given git path as,


cd vendor/plugins
git clone git://github.com/odorcicd/authlogic.git
cd authlogic
git checkout --track -b rails3 origin/rails3

After this, restarted application, and app works fine with Passenger, Mongrel, and WEBrick.

Hope this is helpful.

Advertisements

Posted in Useful Links | Tagged: , , , | Leave a Comment »

Git – create git branch

Posted by firstruby on November 2, 2008

Create new branch “demo” as,

1) git branch demo

This will create local branch “demo”

2) git checkout demo

This will switched to that branch

3) make some changes in that code, then,

git add <files>
git commit -m "<your message>"

4) git push origin demo

This will create new remote branch “demo” on github.

5) If you want someone to checkout the code from “demo” branch, then do following,

git clone <git-path>

then,

git checkout --track -b demo origin/demo

Now, you are in “demo” branch.

Posted in Blogroll, firstruby, Useful Links | Tagged: , , | 1 Comment »

GIT with branches

Posted by firstruby on October 31, 2008

In SVN,  we can create standard repository structure like,
– trunk       – current code
– branches – versions
– tags
such as we can store the code in different branches in GIT,
git push origin demo1.0
where demo1.0 – name of the branch

Posted in Blogroll, firstruby, Useful Links | Tagged: , | Leave a Comment »

GIT – Fast Version Control System

Posted by firstruby on October 25, 2008

GIT is distributed version control system. Following is a small stuff which may help to use GIT with our applications,

Goto root directory of the application, say my application is ‘demo’.

1. To take the code from GIT server,

bango@bango-desktop:~$ git clone <git-url>

After that, I need to change my directory to ‘/demo’.  To update the code from GIT server,

bango@bango-desktop:~/demo$ git pull

2. Once you complete the functionality, and if you want to commit the code to GIT server, then

bango@bango-desktop:~/demo$ git status

‘git status’ will show you the names of all changed files.

3. To add changed files to GIT server,

bango@bango-desktop:~/demo$ git add <path_of_the_1st_changed_file>
bango@bango-desktop:~/demo$ git add <path_of_the_2nd_changed_file>

like this, add all files.. and if you have many files and if you want to add them at a time, then

bango@bango-desktop:~/demo$ git add .

4. To commit the code to GIT server,

bango@bango-desktop:~/demo$ git commit -m “<your-message-regarding-the-functionality>”

5. To push the code to GIT server,

bango@bango-desktop:~/demo$ git push origin master

You may find more commands here…  http://www.kernel.org/pub/software/scm/git/docs/

I am using GIT with my RubyOnRails applications.

Posted in Useful Links | Tagged: , | Leave a Comment »