Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Biggest gripe I had with rails is its learning curve. I have started to read Michael Hartl's impressive tutorial book but gave up when I started to deal with errors related to gemfile dependencies (if the versions do not match with the tutorial the expected outcome does not happen at best or you deal with errors at worst). I have bought Agile Web Development with Rails and thinking to start again because it is really new and I don't believe I'll encounter any problems. What do you do when you encounter such errors by the way?


The Rails Tutorial is at least as up-to-date as Agile Web Development with Rails. For example, two weeks ago I bumped the version of RSpec used in the tutorial, fixing a few minor bugs in the process. Just be sure to use the online version at http://railstutorial.org/book or the most recent ebook from http://railstutorial.org/ so that you get the freshest copy.

If you use the Gemfile at http://railstutorial.org/gemfile in a clean Ruby environment and run bundle install, the issue of dependencies shouldn't even come up. If you continue to have trouble, drop me a line at admin@railstutorial.org.


Run `git blame` on the code pathway that's throwing the exception (in the gem.) Look at the changes that have occurred on it and either move back to a version of the gem that works, or change my code to suit the new version.

Alternatively, look at the changelog or just manually decrement the version number until my tests pass, obviously taking care not to move back past any critical security updates.

Also, the precise version numbers used in railstutorial are available in the code listings here: https://github.com/railstutorial/sample_app_2nd_ed/blob/mast...

The (fast paced|aglie|slapdash) nature of the rails ecosystem does necessitate a certain degree of attention to detail when it comes to versioning. However this applies equally to sinatra. It's worse with node.


Thank you. Far as I understood there is no easy way to handle those errors. I'll take your comment into consideration when I start to learn it.


Use the source, luke!


but I shouldn't get cocky, eh? :)


In case it wasn't clear, that aphorism is supposed to be telling you to get into the habit of reading the source code of the libraries you use. It is often the fastest way to solve your problems, and you'll learn a lot about the lib and about the language in the process.

Without the ability to do this one can only be a plumber fitting other peoples' appliances.


Han Solo says, "Don't get cocky, kid," to Luke.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: