Stephen's Octo Blog

I like to Tinker

Homebrew and PHP 5.5.11 Snag

Upgrading Notes

I updated from 5.5.8 to 5.5.11 today. After the upgrade, I noticed that anything using fpm/php had stopped working with nginx, I was getting a Bad Gateway Error. Checking my console I noticed fpm had spewed out a few errors since the update time, indicating that it wasn’t working. I tried running php-fpm from the command line, and it started right up with no problems, all my php sites worked after that. This gave me the impression that something with my plist file, the file for starting php automatically, wasn’t working correctly. That’s when I decided to make a note of this in an article.

In other words:

If you are upgrading from 5.5.8 to 5.5.11 using the command brew upgrade be aware that the .plist file used in .11 might be spelled differently than what’s in .8. This, depending on how your environment is setup could break your php-fpm, and possibly php. Make sure to swap out the file names by running these commands first:

1
2
launchctl unload ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist && rm ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist
ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents && launchctl load homebrew.mxcl.php55.plist

Additional Notes:

  • This affects you if you symlink the .plist files to ~/Library/LaunchAgents, or if you cp them as well, since the file is a different name.

  • My plist prior to 5.5.11 was always a variant of this: homebrew-php.josegonzalez.php5x.plist. After the upgrade it’s now named homebrew.mxcl.php55.plist.

Fords on Fourth Car Show

I went to a local car show called Fords on Fourth yesterday. Here are some of the photos I took. Lots of mustangs really, but here’s some of them. More of them are located here in my Tucson Album: Album: Tucson

Gist Test

I wanted to try posting gists as a test. It seems to work fairly well, but for some reason I was having problems with it not finding it resulting in a 301 error.

Here’s a codeblock example:

Meh - hello.rb
1
puts "Hi!" unless sad

RVM Missing on Mac

Turns out that I messed something installing dotfiles, which is the only thing I can think of at the moment that would cause this. What happened was the Mac I’m using didn’t notice that I had ruby and rvm installed in my home folder, so it started using the version of ruby installed in Homebrew. That meant something had altered my .bash_profile so I decided to check it out.

I checked my bash_profile, which originally that’s where the link for rvm was installed.

The three locations are either ~.bashrc, ~.bash_profile, or ~.profile, either of these three would need to be checked.

1
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

This appeared to solve my issue and I was able to get back to using ruby.

Update: I was having another issue where rvm kept using the system installed ruby version. I set the new version 2.1.1 to be default, which seems to have resolved my issue. It was pretty annoying.

I tried setting it again using this command:

rvm get stable --auto-dotfiles

It temporarily works, closing the terminal appears to reset it back to the original issue. So I tried setting a default with RVM using:

rvm use 2.1.1 default

This solved my issue, and instead of using the local copy, it uses the .rvm version. However here is what’s shown if I echo $PATH:

1
/Users/QuickMirror/Dropbox/dotfiles:/Users/QuickMirror/.rvm/gems/ruby-2.1.1/bin:/Users/QuickMirror/.rvm/gems/ruby-2.1.1@global/bin:/Users/QuickMirror/.rvm/rubies/ruby-2.1.1/bin:/Users/QuickMirror/bin:$HOME/Dropbox/dotfiles:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/QuickMirror/.rvm/bin

As you can see dotfiles still shows up in from which actually made me realize, I was using .path as an older alternative to try and get dotfiles to work, so I ended up removing that piece which solved my $PATH issue. Echoing $PATH now shows the proper order:

1
/Users/QuickMirror/.rvm/gems/ruby-2.1.1/bin:/Users/QuickMirror/.rvm/gems/ruby-2.1.1@global/bin:/Users/QuickMirror/.rvm/rubies/ruby-2.1.1/bin:/Users/QuickMirror/bin:$HOME/Dropbox/dotfiles:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/QuickMirror/.rvm/bin

How to Remove MySQL Installation on Mac

I found this was pretty useful when learning more about Ruby on Rails and determining that it’s not useful to use mamp’s mysql for this learning:

http://steveno.wordpress.com/2009/03/26/uninstall-mysql-on-mac-os-x/

Use these commands in terminal, it definitely helped me:

1
2
3
4
5
6
7
8
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

I ended up using gems to install mysql, which apparently has solved the issue. These commands will mess up your mysql installation with MAMP, so you will have to reinstall the MAMP package if you want MySQL to work with it correctly. Reinstalling over your current installation shouldn’t delete any of your databases, but you will have to reset your settings for MAMP.

Add WP_PageNavi Function Into Your Theme for Later

Note: This is a previous posting. I’m migrating my old site from Wordpress to Octopress.

Here’s a quick snippet for installing into your theme. I’ve found it very useful.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if(function_exists('wp_pagenavi')){
wp_pagenavi();

}
else {
echo "<div class='nav-previous'><!-- next_post_link --></div>
<div class='nav-next'><!-- previous_post_link --></div>";
}

} 
else { 
echo "<div class='nav-previous'><!-- next_post_link --></div>
<div class='nav-next'><!-- previous_post_link --></div>";
}

It’s that simple. That way if you need don’t have it installed, you still get the right navigation anyways. My theme is based off the html5 reset theme so instead of the typical nav buttons. it’s a little more simple than that.

Anyways I hope this is helpful. :)

Hi

Hi there, again. I actually had to redo the site, because my environment for ruby ended up getting messed up. I still have a few things to learn about ruby, but for now I redid what I started with, and will likely try importing my old wordpress posts to make this site of some use to people. For now, wordpress stays gone until I feel like bringing it back. I’d also like to try making some more areas, possibly a laravel site as a test case.

Update: I will be slowly adding pages that I feel are the most useful from my site to ensure that data is still be shared.