

The First Step for Ruby on Rails - anto210
http://www.jamesjohnson.me/

======
jeffclark
I've been following through the online version of Michael Hartl's RoR book:
<http://ruby.railstutorial.org/ruby-on-rails-tutorial-book>

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.

~~~
mhartl
Thanks! Glad you like it. As you probably know, there's already a Rails
Tutorial chapter (and screencast) on Rails 3.1, but I'm also working on a full
3.1 update as well. Look for the new book in November or December, with the
screencasts to follow a couple of months later. Sign up for the news feed for
the latest updates: <http://feeds.feedburner.com/railstutorial>

~~~
hello_moto
Hi Michael, got a few questions for you:

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.

~~~
mhartl
The supplementary Rails 3.1 chapter and screencast were free for existing
customers. The full revision won't be free, but existing customers will
receive a substantial discount on the new product.

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. :-)

------
jstepien

      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.

~~~
petercooper
At some point you're downloading something and executing it. Unless you pick
through all of the source code or decompile the binaries you download, you
could get caught at any stage.

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.

------
nicklovescode
Nice guide, I wish I had it when I first started rails. However, vim? I love
vim, and suggest everyone learns it. But if the point of a guide is to teach
the basic installation of ROR, I wouldn't suggest making them open vim, too.

~~~
hasanove
especially when it can be replaced with one line

echo "[[ -s $HOME/.rvm/scripts/rvm ]] && . $HOME/.rvm/scripts/rvm" >>
~/.bashrc

------
jefflinwood
After using rvm, I'd suggest using rbenv
(<https://github.com/sstephenson/rbenv>) instead.

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.

~~~
bradleyland
I hate to single you out, but it's become really hard for me to listen to any
Ruby developers decry "magic" as a bad thing in RVM. RVM is an excellent tool
that was taken down a notch by a hit job needlessly perpetrated by the author
of rbenv.

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.

~~~
mhansen
Monkey patching in ruby has well-known problems (what happens when two
libraries patch the same object?), and now good library maintainers know not
to monkey-patch standard libraries. Neither should RVM.

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?

~~~
codenerdz
Can you explain to me how did RVM cause cd to interfere with your work
experience? Im curious because Ive been using it forever and other than it
executing my .rvmrc files, havent noticed a bit of difference

~~~
mhansen
RVM's overriding of cd isn't portable to other shells. I can't use it in my
favourite shell (fish).

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).

------
sidwyn
I did the step up to "[[ -s $HOME/.rvm/scripts/rvm ]] && .
$HOME/.rvm/scripts/rvm", and then tried "rvm install ruby-1.9.2-p290" but it
said "rvm: command not found". Ideas?

~~~
ranza
I dont belive that bashrc is being executed on a mac as standard. Try:

source ~/.bashrc

If that worked add this to your .bash_profile

[ -f ~/.bashrc ] && . ~/.bashrc

~~~
z92
Yes, that worked! I am on OSX Lion.

------
petercooper
A nice style, but for beginners, why would you suggest going into Vim (or any
editor) with the potential for screwing up? Even RVM's _actual installation
documentation_ says to just do this:

    
    
      echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
    

(from <http://beginrescueend.com/rvm/install/>)

------
stupandaus
This seems a bit oversimplified and misses opportunities to teach a lot of the
fundamentals about Rails as part of the installation process. I still
recommend Agile Web Development with Rails for learning rails:
[http://pragprog.com/book/rails4/agile-web-development-
with-r...](http://pragprog.com/book/rails4/agile-web-development-with-rails)

------
briankim
Quick tip: A Rails IDE like RubyMine (paid) or RadRails (free) is well worth
the money if you are just starting out.

------
rprime
Why you added VIM and RVM into the mix? Those are distractions.

~~~
infinitus_
I agree with you on vim (gedit would have been a better choice), but RVM had
been a huge help when I first started with Rails (and Ruby development) in
general. It took away the need for sudo gem installations, for one.

