Learning to code in the year 2015 is incredible. There are so many tools, guides, manuals, courses, videos, bootcamps, and other such resources created and made available - often for free - that you can easily learn to code. All that is required is the motivation (and patience) to learn the material. You don’t even need a ton of time - you could learn how to make native mobile applications in a few months of learning on weekends.
The first barrier for learning how to code is having the patience to properly set up the right environment for what you are diving into. Between a number of close-enough guides, stackoverflow, and other similar resources, there should be enough material for you to overcome nearly any roadblock. Even with all this, it requires patience from the student. You must be willing to troubleshoot the errors that occur along the way. This might deter you from continuing, but is actually good practice for future debugging of errors in the code you are working on.
In companion to the first barrier, the breadth of skills and things to learn while you are a beginner is such that you can easily become overwhelmed with just the basics. You can spend hours in the weeds reading manuals for revision control systems like Git, learning about ssh key configuration and management, user/file permissions, unix / linux command line interface, and so on. All of this, even before you start seeing arguments about which is the best of different languages, libraries, frameworks, or tools for the particular job. Do you use rbenv or rvm ? Angular or Backbone? Bootstrap or Foundation? LESS or Sass? Do you use an IDE or just a text editor? An open source solution that you manage yourself or a software as a service that gives you less control but does all the heavy lifting?
Fortunately, many of the online courses and materials for learning to code today have been created in reaction to the above - the seemingly overwhelming chaos. You can follow along with the tutorials, use the recommended tools, and learn a little bit of everything as you go.