Preferred Rails 3 and MySQL Installation on OSX Snow Leopard
I'm continually amazed at how many people have issues getting rails and MySQL setup on OSX. I see StackOverflow questions on this every day. In response to one of them, I gave the following answer: http://stackoverflow.com/questions/5513815/uninstall-ruby-on-rails-on-mac-os-x-10-6/5518892#5518892
Due to the unfortunate title of that post, however, I don't think it's very easy to find. So I'm posting it here so I can link to it later.
Here are the steps:
The easiest way to get a basic RoR setup is to use Homebrew to install mysql and RVM to manage rails. If you follow the instructions below, including installation of RVM, you wont need to worry about already failed installations of ruby or rails because they'll basically install everything in it's own location and then repoint your environment to the new ruby and rails installation.
Visit https://github.com/mxcl/homebrew and read up on homebrew. You'll thank me later :)
To install homebrew, run the following from the terminal:
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
Install XCode if you haven't already. Easiest way is to use the disk that came with your Mac.
Install git:
brew install git
Install RVM: (Optional, but great if you want to use Ruby on Rails with ruby 1.9.2). Again, read up on RVM: http://rvm.beginrescueend.com/ Follow the instructions here: http://rvm.beginrescueend.com/rvm/install/ AND DONT FORGET TO DO THE POST INSTALL!!!
Install 1.9.2 and set it to be the default:
rvm install 1.9.2
This will take a while...
rvm --default use 1.9.2
Install Rails
gem install rails
Install mysql
brew install mysql
When this is finished, you will need to initialize your database. The instructions will be given to you when the install finishes. If you skip this, your database won't work. If you closed your terminal and want to see the instructions again you can type "brew info mysql" and it will show them to you. If you have some trouble getting mysql to start, try running this command:
sudo chown -R $USER /usr/local
Create your rails app:
rails new my_app
Update your Gemfile to include
gem 'mysql2'
then run
bundle install
That's it. Good luck and have fun!
Snowy Morning
I'm starting off my new desire to take Black and White photo's with some pics I took this morning. It was a really beautiful morning. Some of these aren't bad for a little point-n-shoot camera :)
Create a Kynetx UI with WAAHUI!!!
As the first part of my Kynetx Developers Contest entry, I'm pleased to annouce the release of WAAHUI!! (pronounced waaaaahooooeeey!). WAAHUI!! is a tool for Kynetx developers to create their own user interfaces for their apps. It's pretty simple actually. WAAHUI!! just gives you a canvas to paint with your Kynetx app. This gives you a place to do the following:
- Create an online identity for your app
- Give users a place to setup and manage entity variables
- Mash data into one place
- Create a launchpad for your app
- Use a predefined template to speed up development
- Run your app without a bookmarklet or browser extension (works on iOS and Android too!)
This first release is pretty trimmed down in functionality right now, but it shows the vision and where WAAHUI!! is going. Some features that are coming:
- More login options (right now you can only login to the site with a twitter account)
- Raise events when things happen on your UI.
- A way to submit themes
- A KRL Module for interacting with WAHUUI!!
So Kynetx developers, HAVE FUN WITH THIS!!!
Offer Accepted!
I am happy to announce that I have accepted an offer from End Point to do primarily ruby and Ruby on Rails work on March 28. I am very excited about working with their amazing team. They have a great group of individuals they've assembled and I can't wait to learn from them. End Point is a mature company that provides consulting services in a wide variety of technologies. If you have any work programming or IT work that you'd like done, you should definitely check them out!
The experience of looking for work over the last 3 weeks has been absolutely amazing. I had three positions I was closley looking at. All three of them were very attractive. In the end, I went with the one that I thought was going to be best not only for me, but for our family. I'm very happy with our decision.
Back to the amazing part: I have amazing friends and associates that I've worked with throughout my career. As soon as word got out that I was looking for work, I was getting calls, emails, and messages like crazy. I couldn't believe the kindness and willingness to help that I received. At one point, the emails were coming in so quickly that I literally couldn't respond to them fast enough. To all of you: Thank You!
I now look forward to taking the next week off to just enjoy my family and attend the Kynetx Impact Conference. Believe it or not, I have been extremely busy looking for work and now I can relax a little bit before putting my full fight and fury into my new job.
Olivia's Baby Blessing
Yesterday was Olivia's baby blessing. I don't know how, but we managed to get this really great family photo too!
Textures and Patterns
Nathan and I went for another walk at lunch today. We went hunting for patterns and textures. I think we found some.
Reverse Words
In the spirit of my last post, I've gone out to try my hand at some other coding quizzes to get a little practice. This next puzzle asks to you to reverse the words in a given string. But this is not a simple as at may seem. Here is the list of words and the desired output:
" " => " ", " " => " ", "hello" => "hello", "hello " => " hello", " hello" => "hello ", "the quick brown fox" => "fox brown quick the", "the quick brown fox" => "fox brown quick the", "the quick brown 42 fox!" => "fox! 42 brown quick the"
So for this little puzzle I took a slightly different approach. I wanted to create a single method that did the conversion so that it could be placed in a testing routine, perhaps something like RSpec. So before I show the answer, I thought I might say that there are ways to do this without using built-in functions. Here's my issue there. Those libraries are given to us for a reason and in day-to-day programming, we wouldn't rewrite them. As such, I've chosen to go ahead and use the String#scan and Array#join methods and a regular expression to solve this puzzle. I did it this way because I wanted to solve the puzzle like I would if I were to encounter it in my day-to-day coding. I get that the purpose of these puzzles is to push you, but I also didn't want to spend a lot of time on this either. Trade-offs.
Here's my answer:
answer_key = {
" " => " ",
" " => " ",
"hello" => "hello",
"hello " => " hello",
" hello" => "hello ",
"the quick brown fox" => "fox brown quick the",
"the quick brown fox" => "fox brown quick the",
"the quick brown 42 fox!" => "fox! 42 brown quick the"
}
def solve(given)
words = given.scan(/\s|\w+(?:!)?/)
return words.reverse.join("")
end
answer_key.each do |given, answer|
puts "*"*20
solved = solve(given)
puts answer == solved ? "You got it!" : "expected: '#{answer}' \n got: '#{solved}'"
end





