Sublime Text 2 perfect PHP development set-up
Lately, I've become a huge fun of Sublime Text 2, which in my humble opinion (OK, not only mine, take a look in here) is best text editor/IDE I've ever used.
I called it IDE (Integrated Development Environment) which isn't really true yet, but it's getting awfully close to become one.
Sublime Text 2 is great on its own, but it really starts to kick ass with help of addons called 'packages'. You can look for them on Internet or browse on wbond website.
OK, but getting to the point: I use ST2 for some time now for PHP development and I tried almost all packages I came across which are even slightly related to my job. In order to get most of them (except one or two) you'll need wbond's Sublime Package Control. Ok, really you CAN install all of them manually, but what's the point of re-inventing the wheel? I'll stick with the easy way if you don't mind ;)
And here is my list, enjoy and maybe throw a suggestion or two if you know something I don't know ;)
- SublimeCodeIntel (https://github.com/Kronuz/SublimeCodeIntel)
This is package I use all the time. It's job is to provide hints related to function, object, variable etc. names. It also hints what methods and parameters are available in objects/classes. It's based on Komodo CodeIntel and sometimes it has some problems working at all. But most of the time it rocks :) - SublimeLinter (https://github.com/SublimeLinter/SublimeLinter)
This package does full-time job for me - it constantly watches what I write and instantly lets me know if something is not OK, for example I forget semi-colon or brackets. - SFTP, paid (http://wbond.net/sublime_packages/sftp)
Great package enabling very comfortable use of SFTP, FTP and FTPS. It supports remote folders browsing, editing and synchronization between local and remote files. Also regular upload, download pn save or file open. - SideBarGit (https://github.com/SublimeText/SideBarGit)
I use Git on daily basis and having an easy and comfortable GUI is essential. This is what this package does - it provides set of most often used functions and integrates it with ST2 via right-click menu. - Tortoise (on Windows only) (http://wbond.net/sublime_packages/tortoise)
I use it as a complementary package to SideBarGit if I'm working in Windows environment. It doesn't have so many features but those what it provide are very helpfull and intuitive.
If you like Tortoise Git but you are working on Linux you might want to check out RabbitVCS. It isn't integrated with ST2, but it provides comfortable right-mouse-click Git GUI. - sublime-github (https://github.com/bgreenlee/sublime-github)
Every developer should use code snippets of some kind. I use Gist provided by GitHub and this package enables me to use them instantly (save/paste). - Tag (https://github.com/SublimeText/Tag)
Great package, which simply takes care of all tag-matching related issues. Love it :) - DocBlockr (https://github.com/spadgos/sublime-jsdocs)
Nobody likes it, at least nobody I know, but as a developer you have to maintain solid code documentation. This is where this package helps - it prepares DocBlock comments for classes, params, methods etc. Speeds up things. - Phpcs (http://soulbroken.co.uk/code/sublimephpcs)
This package adds support for PHP_CodeSniffer to ST2. It checks if you code is written according to one of the standards. Just pick one: Zend, PEAR.. and more :) Check out PHP_CodeSniffer website for configuration details. - TrailingSpaces (https://github.com/SublimeText/TrailingSpaces)
Small horror of every code - empty spaces at lines ends, at the end of file. Especially troublesome if you are working on the code with other developers, who might use different editors/IDEs which might interpret them (empty spaces) differently. - BracketHighlighter (https://github.com/facelessuser/BracketHighlighter)
One of my favorites: clearly highlights matching brackets, quotes etc. Just makes everyday life easier when looking at code with multiple brackets-in-brackets constructions. - DetectSyntax (https://github.com/phillipkoebbe/DetectSyntax)
Detects syntax of opened file. ST2 doesn't always get it right and this packages helps. - EncodingHelper (https://github.com/SublimeText/EncodingHelper)
Detects and displays file encoding and sticks to it. Helpful in shared development environment if someone uses for example IDE with default windows encoding instead of UTF-8. - Sublime Function Name Display (https://github.com/akrabat/SublimeFunctionNameDisplay)
Displays in bottom bar name of a function (or method) in which our cursor is placed. Simple and helpful. - Terminal (http://wbond.net/sublime_packages/terminal)
Using Git or maybe some PEAR packages you might need to switch to console from time to time and do some magic. Maybe use Zend Tool or "bake" something ;) It's just what this plugin is for. - Xdebug (https://github.com/Kindari/SublimeXdebug)
Last but not least - power of Xdebug in ST2. It brings Xdebug capabilities to ST2 and enables debugging as most of "big" IDEs can do.
Few packages I use but don't consider essential:
- Color Highlighter (https://github.com/Monnoroch/ColorHighlighter)
When you move your cursor on color definition (hex, for example) it highlights text with this color. helpful when writing CSS. - ColorPicker (https://github.com/weslly/ColorPicker)
Graphical color picker. Doesn't really need explanation, doesn't it? - Prefixr (http://wbond.net/sublime_packages/prefixr)
This one is nice and I would probably make more use of it if I were developing more CSS :) - All Autocomplete (https://github.com/iamnoah/Autocomplete-All)
Enhances ST2 ability to autocomplete by increasing scope to all opened files, not only one we are currently in. - ApacheConf.tmbundle (https://github.com/colinta/ApacheConf.tmLanguage)
Language definitions for Apache conf and .htaccess files. - Zend-Framework.tmbundle (https://github.com/ybits/Zend-Framework.tmbundle)
Code snippets for developing in Zend Framework. Although I do use ZF I never started to make use of these snippets, at least not of their full potential. - Additional PHP Snippets (https://github.com/stuartherbert/sublime-phpsnippets)
Same here as with Zend Framework snippets. I might some day start to use more of them.
There are also packages for WordPress, ZenCoding or one moving SemiColon out of brackets and many more, but I'm doing all right without them.
GitLab installation on Fedora 16 (with gitolite)
This is updated version of my tutorial for GitLab 2.1. Old version can be found here
GitLab is a wonderful piece of software made by these guys and I'd like to try and install it on Fedora 16 system, as it is most recent Fedora OS at the time I am writnig this. I will base my tutorial on on found here by Déja. Also on my way to successful install I've stumbled upon this description, so I might have gain some experience from it too.
GitLab is Ruby on Rails application and it takes some experience to get it all working because of many, many, many dependencies and packages it needs. It's nothing like simple PHP on Apache installation. But it works and it's worth it, I assure you :)
Let's begin! (by the way: I perform all as root user - again: test environment)
small edit: For people who only want this to work and not necessarily wish to know how and why, I have prepared easy installation scripts in here
another EDIT: GitLab is under heavy development and now it's stable version is 2.1. This means that my guide might be not entirely accurate. Please be cautious. I'll update it soon.
- First of all: I am working on virtual machine with brand new and fresh Fedora 16 installed. Minimal installation, just to make sure nothing messes with GitLab. Consider this a test environment.
- Once you have your OS ready, update it with yum update and also install some packages you will need on the way:
yum install make openssh-clients gcc libxml2 libxml2-devel \ libxslt libxslt-devel python-devel
- Check what version of ruby is available via yum. GitLab needs at least version 1.9.2
yum info ruby
on mine it says that the only available version for me is 1.8.7.357 so I have to get it somewhere else.
- Using RVM to install Ruby.
EDIT: I have switched to ruby 1.9.3p0 - it works and starts a lot faster, you can use it instead of 1.9.2-p290 in this guide.
I will use RVM, which stands for Ruby Version Manager - brilliant tool, which you can use to install and manage your Ruby with ease. Let's check it out, shall we? (you can install Ruby any way you want - I'll just do this RVM way)
Notice use of --with-openssl switch - without that passenger will complain about Ruby OpenSSL support and won't compile in next step.
sudo bash -s stable < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) source /etc/profile.d/rvm.sh rvm install ruby-1.9.2-p290 --with-openssl rvm use ruby-1.9.2-p290 --default
Done. Just like that we have operational Ruby 1.9.2-p290. No RPMs, no going back in time.. nice, huh? :)
- Good. Small (nice) surprise: our RPM installed ruby gems for us, so now we only have to get rails gem.
first, just to make sure everything is up to date, execute:rvm all do gem update --system
now install rails with:
rvm all do gem install rails
- Now we will install apache2 as a webserver and Passenger for ruby apps deployment. I know that most GitLab tutorials use nginx but I really like apache ;)
yum install -y httpd
rvm all do gem install passenger
as I mentioned: I use apache, so I will need passenger module for it:
first some required packages:yum install -y gcc-c++ curl-devel openssl-devel zlib-devel \ httpd-devel apr-devel apr-util-devel
an then use
passenger-install-apache2-module
in order to install it.it gives you 2 information on how to proceed with apache configuration:
- add following lines to /etc/httpd/conf/httpd.conf (at the very end):
LoadModule passenger_module /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.11 PassengerRuby /usr/bin/ruby
- and then create file named default.conf (or gitlab.conf, or something other you like) in /etc/httpd/conf.d/ containing these lines (remember to change to fit your environment):
<VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /somewhere/public <Directory /somewhere/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
(don't worry, we'll come back to this one later)
- add following lines to /etc/httpd/conf/httpd.conf (at the very end):
- Now it is time for gitolite. I won't use gitosis because it is not actively developed any more and I found that new GitLab works better with gitolite.install it with
yum install -y gitolite
now, wasn't that quick? :)
- Now we will need to create new gitolite server configuration and in order to do that we have to generate SSH key-pair. But first things first.
To get us started we will create git user withadduser -r -m --shell /bin/bash \ --comment 'git version control' git mkdir /home/git/.ssh chown git:git -R /home/git/.ssh
Now we have to create SSH keys pair for him:
ssh-keygen -q -o -N '' -t rsa -f /home/git/.ssh/id_rsa
To initialize Gitolite we need to first edit it's default configuration file and change default permissions and then initialize it by using git user:
sed -i 's/0077/0007/g' /usr/share/gitolite/conf/example.gitolite.rc su - git -c "gl-setup -q /home/git/.ssh/id_rsa.pub"
as mentioned here
-
Just to make sure that git user has all necessary access rights to his own home directory after we have added SSH keys for him:
chown git:git -R /home/git/
- OK, time for next requirements: python Pip, I will go with method from original post and NOT use yum for that.
curl http://python-distribute.org/distribute_setup.py | python
and then
easy_install pip
- Database. We need it. We have it already - it was installed on the way as a dependency. Just to make sure check if you have SQLite at list version 3.6 with:
yum info sqlite
I have 3.7.7.1. All we need is SQLite development package, get it with:
yum install -y sqlite-devel
-
And now the main event! GitLabHQ!
I like install web apps in /var/www so we will go there and git clone GitLab:
cd /var/www git clone git://github.com/gitlabhq/gitlabhq.git cd gitlabhq/
we need to use pip to install some python dependencies:
pip install pygments
and bundler gem so it can later on do most of the work for us:
rvm all do gem install bundler
you will need one more dependency for bundle install
yum install -y libicu-devel
finally (remember to be in GitLab directory):
bundle install
(go get yourself a coffee or other treat - it takes a while)
- Redis installation. More about Redis here
yum install -y redis
and start it with:
service redis start
- Preparing config files.
copy database and gitlab config files from example to working copies:
cp config/gitlab.yml.example config/gitlab.yml cp config/database.yml.example config/database.yml
- DB setup:
And now database setup and import:RAILS_ENV=production rake db:setup RAILS_ENV=production rake db:seed_fu
TIP: if you get errors here, check if you don't have 2 versions of rake installed (I had somehow): 0.8.7 and 0.9.2. If you do, remove older with:
gem uninstall rake
and choose appropriate version. If you still have problems try:
gem install rake
-> don't know why, but if it installs again same version of rake, it works.
- Apache virtual host configuration should look something like this (I told you, we will get back to that):file: /etc/httpd/conf.d/gitlab.conf
<VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /var/www/gitlabhq/public <Directory /var/www/gitlabhq/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
- enable apache user, co you can su into this account:
usermod -s /bin/bash -d /var/www/ apache
prepare SSH key for him (actually use one created for git user)
mkdir /var/www/.ssh cp -f /home/git/.ssh/id_rsa /var/www/.ssh/ && chown apache:apache /var/www/.ssh/id_rsa && chmod 600 /var/www/.ssh/id_rsa
add localhost to apache user known_hosts with:
ssh-keyscan localhost >> /var/www/.ssh/known_hosts
also give him permissions to his own home directory with:
chown -R apache:apache /var/www/
- add apache user to git group with:
usermod -a -G git apache
- check if repositories directory has correct permissions, it should be 770. You can set it with
chmod 770 /home/git/repositories/
- double check your firewall (for example iptables) if it allows connections on port 80 to your server.
-
important: Apache won't be able o start with SELinux set to "enforcing". Please set it to permissive.
- start apache server with:
service httpd start
- Now it all should work. Fingers crossed.. go to http://www.yourhost.com
- Now you should be able to log in using these credentials:
user: admin@local.host
pass: 5iveL!feand you're in :)
It wasn't so hard, wasn't it? ;)
Troubleshooting:
- I get error 500 when I enter particular project and try to get into it's "Admin" section. Don't know how to fix it yet.To fix it, check if repositories directory has correct permissions, it should be 770. You can set it with
chmod 770 /home/git/repositories
also set this:
chmod 770 /home/git
- If Passenger insists, that we don't have or he can't see grit library (gem actually, as far as I know) even though we have it.
https://github.com/gitlabhq/grit.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Only resolution to this problem I have found is to (as root) change /usr/local/rvm/gems/ruby-1.9.3-p0/gems ownership to apache user with:
chown apache:root -R /usr/local/rvm/gems/ruby-1.9.3-p0/gems
I know that is not great resolution but it worked for me. If you'll happen to know better way - please let me know, so I can update this tutorial and my knowledge of course ;)
Edit
I found another solution (instead of changing permissions): after first
bundle install
edit Gemfile and in lines containing "git:" remove everything after first comma, for example:
gem "grit", :git => "https://github.com/gitlabhq/grit.git"
should be
gem "grit"
and so on.
then do again
bundle install
and now passenger shouldn't complain any more.
(archive) GitLab installation on Fedora 16 (with gitolite)
This is old version of my tutorial. Most recent version can be found here
GitLab is a wonderful piece of software made by these guys and I'd like to try and install it on Fedora 16 system, as it is most recent Fedora OS at the time I am writnig this. I will base my tutorial on on found here by Déja. Also on my way to successful install I've stumbled upon this description, so I might have gain some experience from it too.
GitLab is Ruby on Rails application and it takes some experience to get it all working because of many, many, many dependencies and packages it needs. It's nothing like simple PHP on Apache installation. But it works and it's worth it, I assure you :)
Let's begin! (by the way: I perform all as root user - again: test environment)
small edit: For people who only want this to work and not necessarily wish to know how and why, I have prepared easy installation scripts in here
- First of all: I am working on virtual machine with brand new and fresh Fedora 16 installed. Minimal installation, just to make sure nothing messes with GitLab. Consider this a test environment.
- Once you have your OS ready, update it with yum update and also install some packages you will need on the way:
yum install make openssh-clients gcc libxml2 libxml2-devel \ libxslt libxslt-devel python-devel
- Check what version of ruby is available via yum. GitLab needs at least version 1.9.2
yum info ruby
on mine it says that the only available version for me is 1.8.7.35 so I have to get it somewhere else.
- Method #1.
I will do as it says here. I have tried it before and it works flawlessly. With one or two catches of course ;)Mentioned catches and tips:- you need wget, if you don't have it already use
yum install -y wget
- other needed packages (plus few dependencies) can be obtained by typing:
yum install -y readline-devel ncurses-devel gdbm-devel \ glibc-devel tcl-devel openssl-devel db4-devel byacc
- if you are using virtual machine, like me, you can first make a snapshot of it, then build ruby RPM package, copy it to you host machine (or network share or whatever place outside virtual machine) and then go back in time to you snapshot. Voila! Clean system ready for further installing GitLab. All you need to do is install earlier created ruby RPM. Anyway this is what I'm gonna do today. Keep it clean.
- last step - your RPM will end up somewhere in ~/rpmbuilds/RPMS directory. It will reside in folder named after your system architecture, in my case: i386
And here is how:
yum install -y rpm-build rpmdevtools rpmdev-setuptree cd ~/rpmbuild/SOURCES wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz cd ~/rpmbuild/SPECS curl https://raw.github.com/imeyer/ruby-1.9.2-rpm/master/ruby19.spec > ruby19.spec rpmbuild -bb ruby19.spec rpm -Uvh ~/rpmbuild/RPMS/x86_64/ruby-1.9.2p290-2.ruby-1.9.2p290-2.i386.rpm
I took my VM about 4 minutes to compile and prepare RPM. Not so bad.
Now I go back in time in my VM and install newly created RPM withrpm -Uvh ruby-1.9.2p290-2.fc16.i386.rpm
- you need wget, if you don't have it already use
- Method #2. ( I prefer this one so far)
EDIT: I have switched to ruby 1.9.3p0 - it works and starts a lot faster, you can use it instead of 1.9.2-p290 in this guide.
I will use RVM, which stands for Ruby Version Manager - brilliant tool, which you can use to install and manage your Ruby with ease. Let's check it out, shall we?
sudo bash -s stable < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) source /etc/profile.d/rvm.sh rvm install ruby-1.9.2-p290 rvm use ruby-1.9.2-p290 --default
Done. Just like that we have operational Ruby 1.9.2-p290. No RPMs, bo going back in time.. nice, huh? :)
- Good. Small (nice) surprise: our RPM installed ruby gems for us, so now we only have to get rails gem.
first, just to make sure everything is up to date, execute:gem update --system
now install rails with:
gem install rails
- Now we will install apache2 as a webserver and Passenger for ruby apps deployment. I know that most GitLab tutorials use nginx but I really like apache ;)
yum install -y httpd
gem install passenger
as I mentioned: I use apache, so I will need passenger module for it:
first some required packages:yum install gcc-c++ curl-devel openssl-devel zlib-devel \ httpd-devel apr-devel apr-util-devel
an then use
passenger-install-apache2-module
in order to install it.it gives you 2 information on how to proceed with apache configuration:
- add following lines to /etc/httpd/conf/httpd.conf (at the very end):
LoadModule passenger_module /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.11 PassengerRuby /usr/bin/ruby
- and then create file named default.conf (or gitlab.conf, or something other you fancy) in /etc/httpd/conf.d/ containing these lines (remember to change to fit your environment):
<VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /somewhere/public <Directory /somewhere/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
(don't worry, we'll come back to this one later)
- add following lines to /etc/httpd/conf/httpd.conf (at the very end):
- Now it is time for gitolite. I won't use gitosis because it is not actively developed any more and I found that new GitLab works better with gitolite.install it with
yum install -y gitolite
now, wasn't that quick? :)
- Now we will need to create new gitolite server configuration and in order to do that we have to generate SSH key-pair. But first things first.
To get us started su into gitolite user withsu - gitolite
now try to log into localhost via SSH -> it's small thing which will make our life easier in the future.
ssh localhost
Just make it add localhost to list of known host - no need to actually authenticate. SSH created for us ~/.ssh directory. That's nice.SSH key generation is as easy as:
ssh-keygen -t rsa
use default path for saving key-pair (/var/lib/gitolite/.ssh/id_rsa) and no paraphrase. Test environment. Just a reminder.as for initialization of gitolite repository:
gl-setup .ssh/id_rsa.pub
next hit ENTER and edit will open, change value of
$REPO_UMASK to 0007
as mentioned hereLook like we are done here. Exit gitolite user shell and return to being almighty root himself ;)
- OK, time for next requirements: python Pip, I will go with method from original post and NOT use yum for that.
curl http://python-distribute.org/distribute_setup.py | python
and then
easy_install pip
- Database. We need it. We have it already - it was installed on the way as a dependency. Just to make sure check if you have SQLite at list version 3.6 with:
yum info sqlite
I have 3.7.7.1. All we need is SQLite development package, get it with:
yum install sqlite-devel
-
And now the main event! GitLabHQ!
I like install web apps in /var/www so we will go there and git clone GitLab:
cd /var/www git clone git://github.com/gitlabhq/gitlabhq.git cd gitlabhq/
we need to use pip to install some python dependencies:
pip install pygments
and bundler gem so it can later on do most of the work for us:
gem install bundler
finally (remember to be in GitLab directory):
bundle install
(go get yourself a coffee or other treat - it takes w while)
- DB setup:
EDIT: For GitLab version 2.1 install Redis - without it rake will fail.:
yum install redis libicu-devel service redis start
And now database setup and import:
RAILS_ENV=production rake db:setup RAILS_ENV=production rake db:seed_fu
TIP: if you get errors here, check if you don't have 2 versions of rake installed (I had somehow): 0.8.7 and 0.9.2. If you do, remove older with:
gem uninstall rake
and choose appropriate version. If you still have problems try:
gem install rake
-> don't know why, but if it installs again same version of rake, it works.
- Apache virtual host configuration should look something like this (I told you, we will get back to that):file: /etc/httpd/conf.d/gitlab.conf
<VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /var/www/gitlabhq/public <Directory /var/www/gitlabhq/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
- set correct settings in /var/www/gitlabhq/config/gitlab.yml
in my case:# Git Hosting configuration
git_host: system: gitolite admin_uri: gitolite@localhost:gitolite-admin base_path: /var/lib/gitolite/repositories/ host: localhost git_user: gitolite # port: 22
- enable apache user, co you can su into this account:
usermod -s /bin/bash -d /var/www/ apache
also give him permissions to his own home directory with:
chown -R apache:apache /var/www/
(I know this kinda overrides last chown command...)
- do:
su - apache && ssh localhost
(same thing as in step 8. with know_hosts file. )
exit apache's shell and as root copy id_rsa private key from /var/lib/gitolite/.ssh/ to /var/www/.ssh/ and make apache it's owner with:cp -f /var/lib/gitolite/.ssh/id_rsa /var/www/.ssh/ \ && chown apache:apache /var/www/.ssh/id_rsa \ && chmod 600 /var/www/.ssh/id_rsa
- add apache user to gitolite group with:
usermod -a -G gitolite apache
- check if repositories directory has correct permissions, it should be 770. You can set it with
chmod 770 /var/lib/gitolite/repositories/
- double check your firewall (for example iptables) if it allows connections on port 80 to your server.
- start apache server with:
service httpd start
- Now it all should work. Fingers crossed.. go to http://www.yourhost.com
- Now you should be able to log in using these credentials:
user: admin@local.host
pass: 5iveL!feand you're in :)
It wasn't so hard, wasn't it? ;)
Troubleshooting:
- I get error 500 when I enter particular project and try to get into it's "Admin" section. Don't know how to fix it yet.To fix it, check if repositories directory has correct permissions, it should be 770. You can set it with
chmod 770 /var/lib/gitolite/repositories/
- If Passenger insists, that we don't have or he can't see grit library (gem actually, as far as I know) even though we have it.
https://github.com/gitlabhq/grit.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
I didn't have gem grit installed, do:
gem install grit
also it won't hurt to update all gems with:
gem update
Only resolution to this problem I have found is to run bundle again as a user who runs apache server: apache.Su into apache account with
su - apache
and try:
gem install grit
you'll get error:
You don't have write permissions into the /usr/lib/ruby/gems/1.9.1 directory.
As root change it's ownership to apache user with:
chown apache:root -R /usr/lib/ruby/gems
I know that is not great resolution but it worked for me. If you'll happen to know better way - please let me know, so I can update this tutorial and my knowledge of course ;)
Edit
I found another solution (instead of changing permissions): after first
bundle install
edit Gemfile and in lines containing "git:" remove everything after first comma, for example:
gem "grit", :git => "https://github.com/gitlabhq/grit.git"
should be
gem "grit"
then do again
bundle install
and now passenger shouldn't complain any more.