Wednesday, October 9, 2013

changing git remote origin

#to list all remote url
git remote -v

#to remove existing remote (not reversible)
git remote remove [name]
eg: git remote rm origin

#then you may add your new remote
git remote add origin ssh://git destination/...


Tuesday, October 8, 2013

rails mysql2 install fail

if you encounter No such method for Nil Class,
its due to a bug in mysql2 v0.3.13,

so try to install
gem install mysql2 -v 0.3.11

to get it installed on windows, you will need the right connector library to be installed.
first, download the zip file of the mysql connector, and extract it.
v0.3.11 requires mysql-connector-c-noinstall-6.0.2-win32

next, install using this command:
gem install mysql2 -v 0.3.11 --platform=ruby -- --with-opt-dir="C:\path-to\mysql-connector-c-noinstall-6.0.2-win32"

after installed, makesure to copy C:\path-to\mysql-connector-c-noinstall-6.0.2-win32\lib\libmysql.dll to c:\Ruby200\bin\

Note: nokogiri currently desnt support ruby 64bits.
so try to use 32bits if you need to use it.