#105
May 12, 2008

Gitting Rails 2.1 RC1

Rails 2.1 Release Candidate 1 was just released! In this episode I will show you how to install it into your Rails project.
Download (27.7 MB, 6:17)
alternative download for iPod & Apple TV (10.2 MB, 6:17)

Resources

git clone git://github.com/rails/rails.git
git pull
git checkout v2.1.0_RC1
git checkout master
rake rails:update
script/dbconsole

27 comments

Mikel Lindsaar May 12, 2008 at 00:43

Ryan, thanks for the great episode on GIT! I was hoping you would do one like this and I wasn't disappointed.

Also, thanks to all the sponsors for the grand prize, I really didn't expect to win, but it is a lot of fun helping others and I am glad I could help and help other people learn more about rails!

Mikel


James May 12, 2008 at 00:44

Woot! I'm the first!

(@_@)


James May 12, 2008 at 00:48

(ò_ô) What!!

@Mikel, congrats!


Russell Jones May 12, 2008 at 00:58

Awesome episode Ryan, thanks. One note: I couldn't find the link to your contest results anywhere on your homepage, though i was able to derive it from the screenshot at the tail end of this episode.


Trevor Turk May 12, 2008 at 06:54

Note that you can use the depth option in git to keep your "frozen" vendored much smaller by not downloading all of the project history:

git clone git://github.com/rails/rails.git --depth 1


Ryan Bates May 12, 2008 at 07:39

@Russell, I added a link in the show notes, hopefully that will be okay.

@Trevor, you're right, good point!


Fred May 12, 2008 at 08:48

Why is this better than "sudo gem install rails –source http://gems.rubyonrails.com?"

An obviously non-programmer newbie.


Peter Jackson May 12, 2008 at 09:33

@Fred: There are a few reasons.

First, I'm not certain that the RC is available as a gem yet.

Even is if is, there are a couple reasons this might be better.

1. You don't want to upgrade every app running on your machine before you've had a chance to check out how the new framework will affect your code. So installing Rails into the vendor directory is a little "safer" in that it breaks one app instead of all of your apps.

2. A lot of rubyists are on shared hosts and can't run "sudo gem install" anything.


Ryan Bates May 12, 2008 at 11:51

@Fred, that should work too, and I should have mentioned it. I just prefer to update an individual project through the vendor directory so I don't unintentionally update another project. At least until the final 2.1 is released.


Fred May 12, 2008 at 11:51

@Peter

Thanks for the answers. Glad I asked. I'm trying to get started with Rails (working through Agile...) and hard to figure out how all the Rails and Ruby pieces fit together particularly since so many new pieces being developed: Merb, Rubinus, Passenger, Rack, Mongrel, RSpec, Mephisto etc. Trying to figure out what I need to pay attention to and what I don't.


Mike Wyatt May 12, 2008 at 12:11

I'm getting this error when I try to run anything like the about, console or server scripts

/Library/Ruby/Site/1.8/rubygems.rb:139:in `activate':Gem::Exception: can't activate activesupport (>= 1.4.1), already activated activesupport-2.0.991]


Bjarki May 12, 2008 at 15:10

Nice episode as always :) I have watched all your episode and as a result I have learned a whole lot about how to develop Rails applications. I have been trying these past days to find a good tutorial on how to upload files, images to be exact :). Is it possible you could do an episode on how to do this in Rails 2.1 in the near future? I have done a little experimenting with Django and uploading images there is very simple. I have followed a few Rails examples on this but they seem out-dated and "hackish". Sorry about the long comment, keep up the excellent work. I look forward to a new episode every Monday 8-)


Abdullah May 12, 2008 at 17:46

The best feature of rails 2.1:
3 railscasts a week.. WOHOO!
go Ryan!


Matt May 12, 2008 at 18:12

@Mike

Try removing any other versions of Ruby apart from the one that ships with OS X 10.5. (The MacPorts install of Ruby was occasionally causing this conflict after I upgraded.)


Mike Wyatt May 12, 2008 at 21:52

there's no other traces of ruby on my ststem aside from what is shipped with leopard

:(


Ryan Bates May 12, 2008 at 22:27

@Mike, interesting, I'm not familiar with that error. Perhaps post it on the mailing list along with the steps took to trigger it.

groups.google.com/group/rubyonrails-talk


Sam Aaron May 13, 2008 at 06:54

Hey Ryan,

nice screencast (as always). Is there any chance you could clarify the repercussions of cloning an external git repository (as you suggest) inside a project which itself is already managed by git.?

So far I have been using braid (http://github.com/evilchelu/braid/tree/master) to pull in external git repositories (which I think links to the repositories as a submodule in a separate branch). This is mainly because I assumed there might be issues with storing git repositories within git repositories. However, I may be wrong...

Anway, suffice to say, a lot of this git stuff is still new to me, and probably a lot of other people too :-)


Sam Aaron May 13, 2008 at 06:58

Oh, while on the subject of using git to pull in external repositories, this post by Graeme Mathieson might be useful to people:

http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/


Carl May 13, 2008 at 10:11

Has anyone else noticed anything odd about the sound in some of these episodes (for example this one)? I'm using Quicktime on Windows and at 5:47 seconds there is a small cutout in the sound, and if you look at the timer in the lower left hand corner it stops updating for about 2 seconds and skips to 5:50. There are a couple of other points where it does the same thing, and I've heard in it a few other railscasts, and I'm wondering if it is just my system, can anyone else verify this?


David May 13, 2008 at 20:05

Yes, I am using submodules to track all plugins where possible. I like that it keeps a list of everything managed by git in a single .gitmodules file at the root of your main project.


kino May 13, 2008 at 21:44

where can take video tutorila by GIT?


Peter Jackson May 19, 2008 at 07:44

@Mike:

/Library/Ruby/Site/1.8/rubygems.rb:139:in `activate':Gem::Exception: can't activate activesupport (>= 1.4.1), already activated activesupport-2.0.991]

I have run into this error frequently. Two things you can do to fix it:

1. If it is an option for you, run 'sudo gem cleanup' to clean out old versions of rails gems.

2. Look for code in your app that extends ActiveRecord. The "Oracle find_rows" patch and the Oracle "prefetch_primary_key" patch are two common culprits. Check environment.rb for anything that messes with AR.

Is your project open-source or sharable? If so, send me a pointer to your repository and I'll take a look.


mike wyatt May 23, 2008 at 12:31

for the record, I got my little problem cleared up a couple of days after-the-fact

http://rails.lighthouseapp.com/projects/8994/tickets/176-2-1_rc1-won-t-load-on-stock-leopard-setup#ticket-176-3


Lance Ennen May 27, 2008 at 11:06

@Ryan thanks for the screencast!

@Trevor thanks for point out --depth 1

Thanks Steve Purcell for the new script/dbconsole!!


slythic Jun 02, 2008 at 15:45

@Bjarki - I agree about an image uploading tutorial. Very necessary and I think one of the last things to make this site complete. :-)


OA Jun 03, 2008 at 15:26

An imagine uploading tutorial would be great. In fact, it would be really nice if Ryan could suggest something that would combine attachment_fu's S3 capabilities and fleximage plugin's on-the-fly imaging capabilities.

Looking forward to each and every episode as always :)


Steve Purcell Jul 28, 2008 at 00:39

@Lance - you're welcome!

Add your comment:

(SKIP THIS ONE)

(required)

(not shown)


(required)

subscribe:
sponsored by:
if you want to help:
required:
Get Quicktime Player