The First Step for Ruby on Rails(jamesjohnson.me) |
The First Step for Ruby on Rails(jamesjohnson.me) |
It's proven to be a GREAT way to learn the basics from the ground up while building an actual app at the same time.
1) Will the update to 3.1 be free for existing customers?
2) Would you mind to share a bit of your process of making the screencasts?
Thanks!
PS: I have the print book, the pdf, and the screencast. Love them.
The idea behind it was to have more focus on BDD than anything else out there, which is exactly what the community is all about these days.
Just like Michael's brilliant book, we go through building an application from the ground up using Rails 3.1, RSpec, Cucumber and many other gems provided by the community.
copy and paste in the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
It is getting more and more popular to come across such installation recipes. "Just execute this command", which will download some code from the net and run it on your machine. Yes, it's easy and quick but it's terribly insecure, especially without HTTPS. Just take a look at http://npmjs.org . Just imagine the results if npmjs.org gets compromised. This trend is troubling.For a beginner, it makes no difference if they get burnt by a gist or by a compromised package or binary. And they can at least attempt to read https://raw.github.com/gist/323731 in plain text.
And don't forget that something like:
git clone .... sudo make install
is a huge hole for bad things to happen as well.
echo "[[ -s $HOME/.rvm/scripts/rvm ]] && . $HOME/.rvm/scripts/rvm" >> ~/.bashrc
It doesn't try to do as much, so a little less magic. The biggest thing I like is that it doesn't try to do anything with gems, which is good - I've been trying to use bundler for everything.
source ~/.bashrc
If that worked add this to your .bash_profile
[ -f ~/.bashrc ] && . ~/.bashrc
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
(from http://beginrescueend.com/rvm/install/)RVM is no more magic than rbenv, and to listen to Ruby developers (who treasure "magic") talk about it as if RVM commits some cardial sin by overriding `cd` tops out my nerd-rage-meter. Ruby, home of the monkey patchers, has no place calling out RVM for overriding `cd`.
RVM and rbenv serve similar purposes. RVM gives you gemsets as well. You may not need them today, but they're there if you do. I use Ruby for a lot of system administrative tasks. These tasks run inside cron jobs and other places where a bundle really doesn't make sense. Despite the fact that they're no longer in vogue, gemsets are still very useful.
Should you check out rbenv? Yes. But the "little less magic" is a really poor basis by which you should evaluate it as a tool.
The monkey-patching of `cd` is the main reason I'm not using RVM. I depend on `cd` to work, every time, rock solid, especially when my system is unstable. I can't risk having a dependency or bug in their `cd` script breaking my most commonly used shell command.
rbenv has demonstrated that it's not necessary to override `cd` to manage ruby versions, so why does RVM still do it?
* No need to install a second thing (ruby-build) to install rubies.
* No need to do manual things like running "rbenv rehash".
* More chatty and hand-holding (tells you dependencies you need to install for your platform, etc)
What is it about having gemsets that makes it easier for a beginner? Bundler seems to handle installing dependencies just fine.
As far as my publication and production processes go, I have big plans in this direction. I need to make the 3.1 update first, but after that I'll have more details for you. Stay tuned. :-)
Ruby is my go to language for damn near everything. I use it for working with log files, parsing Excel documents & performing analysis, system administration, you name it. Many of these scripts are one-offs that reside in '~/bin'. RVM allows you to do something like this in your shebang:
#!/usr/bin/env ruby-1.9.2-p290@vqm-analysis
That's the first line in a shell script that I wrote to collect examples of bad calls in a csv file output from an AdTran 900-series VoIP gateway. The CSV file contains about 30 columns of data related to the quality of VoIP calls. I have a collection of five or six scripts that use that gemset, but they're not really an application. They just run from '~/bin', so using bundler isn't really practical. I could wrap them up in a gem and make them a proper application, but this is scripting. Simply using RVM + gemsets saves me a lot of time.
My point is that gemsets may or may not have any utility for you, but it's narrow minded to assume that they have no utility for everyone.
With rvm you can create a gemset just for that project youre testing out. Imagine trying to work with different projects that have different versions of ruby, different versions of rubygems and different versions of rails, some gems from github, some gems from source, some gems from rubygems.
A beginner would not be able to sort through the dependency mess this creates. Gemsets help you avoid this nightmare.
Here's the rub. No one ever has a problem with the overridden `cd` command. Community outcry resulted in a reversion of the default returning to it's original configuration.
What bugs the shit out of me is the band-wagoning from people who, frankly, haven't got a clue. They hear that "there be dragons" in RVM, and all of the sudden everyone is running around flailing their hands over their head like RVM installs a custom kernel or something. It's unwarranted, and it all stems from the original hit job pulled by Sam Stephenson when he released rbenv. Meanwhile, all the same people who are screaming about the "magic" in RVM were cluelessly using it for god knows how long before rbenv came along.
Sam has since apologized and will tell you that RVM is a fine tool, but everyone seems to have forgotten that. If you don't want to use RVM, fine, don't use it, but the "reasons" everyone cites for avoiding it are pretty weak in practice. Wayne is one of the strongest bash programmers I've ever seen. I trust him, and every time I've needed him, he's been available in #rvm for help. Go forth and use rbenv, but you don't have to kick dirt on RVM along the way.
Yeah, there's http://beginrescueend.com/integration/fish/, but I tried that and it started printing errors every time I used cd due to some bug (this was over a year ago, there's a good chance it's been fixed, but it just left me really shy about overriding cd).