Setting up a fresh Rails 3.1 project safely
So you want to start experimenting with some of the great new Rails 3.1 features like the new asset pipeline? Follow these instructions and you’ll stay out of trouble.
If you haven’t already, install rvm. Then fire up Terminal and follow these simple steps:
Make sure rvm is up-to-date:
$ rvm get head
$ rvm reload
Get the latest Ruby (1.9.2p180 is recommended for Rails 3.1):
$ rvm install 1.9.2
$ rvm 1.9.2
Get the latest Rails 3.1rc:
$ gem install rails -v ">=3.1.0rc"
Start a new Rails project:
$ rails new rails3play
$ cd rails3play
Set up a new git repository (optional):
$ git init
Create a new rvm project gemset:
$ rvm --rvmrc --create use 1.9.2@rails3play
This will create a new gemset and project .rvmrc file. Edit the .rvmrc file and uncomment the line in the bundler section at the bottom to add ./bin to your $PATH.
Note: rvm will only add this directory to your path when you’re within the project directory, so no worries about it messing up other stuff.
#
# If you use bundler and would like to run bundle each time you enter the
# directory, you can uncomment the following code.
#
export PATH="./bin:$PATH"
This is an important step based on the comments from Yehuda’s blog post about why you should always use bundle exec. Read the post and comments if you want all the background, but essentially this allows you to run executables like rake instead of bundle exec rake and know that you are running the correct version of rake based on properly-resolved Bundler dependencies.
Now you need to leave and re-enter your project’s directory for the new .rvmrc settings to apply:
$ cd ..
$ cd rails3play
Next, run bundle install with the --binstubs flag to create local executable wrappers:
$ bundle install --binstubs
You should now have a new Rails 3.1 project with safe executable gems that respect your Gemfile. Oh, and if you’re using using git:
$ git add .
$ git commit -m "Initial commit"
The conventional wisdom is that you should be checking in your .rvmrc, Gemfile.lock and the new bin directory, so don’t worry about adding anything to .gitignore.
So that’s that’s it! Go make something cool! If you run into any problems, hit me up on twitter
Work Hard, Play Hard
I just returned from a week of traveling along the California Coast. When I go on vacation, I’m usually looking for an opportunity to unwind and recharge. Between the incredible weather and books I brought with me, I succeeded on both counts. Here’s my reading list from the last week:
- Brain Rules
- The Now Habit
- Mastery
- The Talent Code
- Do The Work (free Kindle edition from The Domino Project)
- The War of Art: Break Through the Blocks and Win Your Inner Creative Battles
The books ended up having a surprisingly consistent theme considering it was just the stack of books I had on my “to read” pile. There’s a lot of overlap between them, but they cover the spectrum from overcoming procrastination to the art of mastering skills.
If I had to break it down, the basic lessons are:
- Make time for the important things like exercise, entertainment and socializing
- Spend the rest of your time focusing on work
Or, to be more trite, the secret to success is “work hard, play hard”. When you’re relaxing or recharging, make sure you’re completely committed to it. When you’re watching TV or playing with your niece, do it with total focus. Don’t spend your TV time “working” on your laptop - you’ll do both poorly. Make conscious choices with your time and make it count.
Like all good advice, it sounds like common sense when you hear it. If you want to lose weight, all you need to do is eat less and work out more, right? Similarly, “work hard, play hard” is easier said than done. Fortunately, there are tons of great tools and ideas within each of these books to help guide you. There’s also a healthy dose of inspiration to get you going.
Takeaways
To get the most out of a book, spend the time to write down what you’ve learned or what you’re actually going to do differently. Here are some of the key bits of information and actions I’m going to take from these books.
- The only way to get better at something is by doing
- Get out of your comfort zone regularly (from The Talent Code)
- Make an “unschedule” (from The Now Habit)
- Work for at least one uninterrupted hour every morning in my home office
If you want a quick dose of inspiration, start with Do The Work (it’s free!). If that gets you going, I’d highly recommend picking up The Talent Code to learn the best ways to improve your skills. And remember:
Girls only want boyfriends who have great skills.
— Napoleon Dynamite
SkillBonsai: the skill tree for your life
Two weeks ago, Jake Goulding and I launched SkillBonsai. We took the week off work and used the whole staycation to kickstart it. This is an idea that we’ve been kicking around for a few months now, but decided to make a concerted effort to get things off the ground.
What is it?
SkillBonsai is a collection of community-created skill trees that guide you through the learning and skill development process. Based on skill or technology trees popularized by role-playing games like Diablo, Civilization, or EVE Online, SkillBonsai allows you to level up in real life.
Decide how to allocate your precious resources and focus your efforts as efficiently as possible. In a video game, you have to decide how to invest your experience points. In real life, you invest your time. SkillBonsai solves two main problems:
- It encourages you to focus on what skills you want to improve.
- It provides a guided path how to improve your skills.
Imagine a broad topic like web development. There is a daunting body of knowledge required to become proficient in web development and many different paths you could take. Here’s a simple view of a web development skill tree (click for full size):
Each one of those nodes in the tree would give you a sequence of steps to master that topic. Once you complete a node in the tree, more options open up for you to explore. You can either dig deep into Ruby or just learn enough to get started with a Rails app.
This is just one simple perspective on web development. You could imagine having many different skill trees that provide different slices of technology and skills.
Motivation
SkillBonsai was born out of the need to know the best resources and methods for learning a new skill. I’ve always been a self-paced learner. I come by it honestly - my dad taught my sister and me basketball from a book when we were 8 and 6 years old respectively. We didn’t know the first thing about basketball and didn’t have a basketball hoop. So, with my dad as coach and a book as our guide, we focused on the fundamentals in our basement: ball handling, passing, and defense. I didn’t turn out to be the best basketball player in the world, but those fundamentals gave me an edge for years to come. Now, every time I want to learn a new skill, Amazon is my first stop.
In the new year, I decided that I wanted to make a deliberate attempt to get better at web development with a specific focus on Ruby, Rails and Design. After reading The Art of Learning, I’ve become convinced that learning and mastering the fundamentals is key for excelling in anything. I was determined to get down to the fundamentals and make time for deliberate practice. Deliberate is the key here. And, in order to make the most of my practice time, I needed to know the right skills and resources to learn them.
Though I’ve been using Photoshop for over 10 years now (it feels weird to say that), I can’t say I’ve ever mastered some of the fundamentals like paths and layer masks. I was ready to go back to the basics and really master these tools so I could get to the next level.
Amazon didn’t seem to have clear cut answers on the best books for my specific needs, so I asked Quora for advice. I asked what the best books were for learning the fundamentals of Photoshop for web design; specifically not Photoshop for photographers.
The first response pointed to two books for photographers (not what I asked for), but then there were additional recommendations for screencasts from Adobe TV and Lynda.com.
This was like a lightbulb going off for me. Not only was it difficult to find an “authoritative” source for learning progression and resources, but there really are a wide variety of learning methods beyond books. At the very least, there are:
- Books
- Screencasts (e.g. Lynda.com, Railscasts, PeepCode)
- Articles (e.g. blog posts, academic papers, eBooks)
- Practice (e.g. katas, koans, code retreats)
- Training classes (The Compleat Rubyist)
- Mentorships (e.g. Ruby Mendicant University, P2PU)
By combining the skill tree concept with a list of the best available resources, I think we could have something.
Next steps
It is still in the very early stages, but you can sign up to secure a place in line to be a beta tester. We’re following the Lean Startup methodology for Customer Development on top of Agile Product Development. This means we will be shipping early and often to build something of real value to the community. If this idea sounds useful to use, please sign up and help guide us in the right direction.
The “Saturday Morning Laundry” secret to productivity
I do laundry early most Saturday mornings. It’s a ritual.
Why is that interesting? Because it has an amazing effect on my weekend productivity. It’s easy to do and I feel an inordinate amount of accomplishment when I’m done.
I noticed about a year ago how the simple act of putting clothes into the wash automatically jump starts me to do other productive things. I start picking things up around the house, writing some code, or doing something else that just needs to get done. A sense of accomplishment begets productivity.
The Saturday morning laundry keys to success:
- Start early (I try to put the first load in by 9:00am)
- Fold and put away clothes when they’re done
Easy, right? That second step is important. You have to finish the task. Sometimes, I’ll do my laundry, but fail to actually fold and put it away. Then I have to sift through my laundry basket for clothes throughout the week. It’s inconvenient and oddly demotivating. Each morning, it reminds me that I didn’t follow through with a simple task. On the flip side, for some reason it just feels really nice to reach into a full drawer of clean clothes and get dressed in the morning without hassle.
One common reactioin I’ve heard to this theory when I’ve told people about it is, “Why do you need to be productive on a weekend?” While being productive is probably not the best goal for a weekend, there are usually at least a few things that I’d like to get done. If I can use the spark created by doing my laundry, I can knock them off the list early and truly relax for the rest of the weekend.
So how can you use this idea in your work life? What “Saturday morning laundry” can you do to start your work day? Try to accomplish just one thing before checking your email in the morning. It doesn’t have to be big, but you have to finish it. The effect on your motivation will be considerable.
How to Make Lots of Money During a Recession
(via Instapaper)
Game Deaths (by boingboingvideo)
