Sunday, November 2, 2014

Dyld issue when setting up new Rails repository

Problem:  I have updated OS X Mavericks and setup new Rails environment with latest gems in the GemFile. When running bundle install I got his issue below:
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/tech3/.rvm/rubies/ruby-2.1.4/bin/ruby
  Reason: image not found

Trace/BPT trap: 5
Solution: brew update && brew install gmp && rvm reinstall 2.1.4

Friday, September 26, 2014

Autostart App on Macintosh, just load PLIST files at LaunchAgents such as (Mysql, Mongod and Redis)

Mysql 


brew info mysql
mkdir -p ~/Library/LaunchAgents
cp `brew --prefix mysql`/*mysql*.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/*mysql*.plist

or 

cp /usr/local/opt/mysql/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist



Mongod 

Create a file call org.mongo.mongod.plist in /Library/LaunchDaemons/

If you use vim you can do like this:
sudo vim /Library/LaunchDaemons/org.mongo.mongod.plist  

Copy and paste this:
 
 
"1.0">  
 
    Label
    org.mongo.mongod
    RunAtLoad
   
    ProgramArguments
   
        /usr/local/bin/mongod
        --dbpath
        /var/lib/mongodb/
        --logpath
        /var/log/mongodb.log
   
 


Also, you will need to create a file for the log and a directory for the database.
sudo touch /var/log/mongodb.log  
sudo mkdir /var/lib/mongodb  

And run this in your terminal:
sudo chown root:wheel /Library/LaunchDaemons/org.mongo.mongod.plist  
sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist  
sudo launchctl start org.mongo.mongod  


Redis

To have launchd start redis at login:
    ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
    redis-server /usr/local/etc/redis.conf

Tuesday, July 15, 2014

Incorrect MySQL client library version!

Recently I upgraded my OS X from Snow Leopard to Mavericks in preparation for Yosimate. A lot of dependencies have changed in the latest OS X that breaks my gems for my previous RVM environment (still ruby-1.9.3-p125)

I had this case whereby my I test and rake script "announcement" like I used to run on my development mode in Ruby on Rails.

bundle exec rake announcement:announce_bcc RAILS_ENV=development

Development mode on Rails. Unfortunately I got an error stating that:

Incorrect MySQL client library version! This gem was compiled for 5.5.14 but the client library is 5.6.19.

What I did to solve the issue was to upgrade my gems such as (bundle and rake).

gem update bundler
gem update rake

What solve the issues was to update my mysql2 gem. So what I saw from an article at
Install the mysql2 for a specific mysql client so I just update the mysql2 using gem prestine command.

gem pristine mysql2

This solves the problems and I was able to run the normal RAKE SCRIPT file in my local development.

Comment in if you have similar issues and wants to share insites for us both. ciao c",)

Thursday, July 3, 2014

Learning Paypal API

Recently I'm learning the API of Paypal because it is important on developing applications when payment made by clients using Paypal. Currently i'm residing in Singapore and this link will help me or you when you want to explore Paypal integration on your web applications.

https://developer.paypal.com/docs/api/

FileMaker Desktop Publishing Database downloading on updater

If you want to download the Updater or FileMaker, here'e the link that you can visit and download.
http://www.filemaker.com/support/downloads/

Rails 4.0 and Devise With Strong Params and Custom Fields


This is a good example of using Strong Parameters on Rails 4.0.1
https://gorails.com/blog/rails-4-0-and-devise-with-strong-params-and-custom-fields

Wednesday, June 11, 2014

Terminal command to get your own IP address

On Terminal:
ifconfig |grep inet | ipconfig getifaddr en1

and on Console:
`ifconfig |grep inet | ipconfig getifaddr en1 `.strip
host = `ifconfig |grep inet | ipconfig getifaddr en1 `.strip