News for hackers. Stuff that matters.
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @06:05PM (#5641116)
This is a huge step forward to a big release! I myself built a little app with the RC, Ruby 2.0, and deployed it to Heroku yesterday, and that whole stack works just fine.

_Please_ give the RC a try, and file any issues you have on the tracker: https://github.com/rails/rails/issues?state=open There's nothing more frustrating as a maintainer than getting regression reports the day after you release when you've done two or three RC releases. :(

I'd be happy to answer any questions you have about the release either here or over email, as well.

Re:Rails 4.0: Release Candidate 1 released by kawsper on Wednesday May 01, 2013 @06:30PM (#5641258)
Sorry for a potential stupid question: Is there an upgrade guide somewhere?

I noticed that mperham mentioned on Twitter that he had 250+ bugs his test-suite after upgrading, and I am sure he and his team have better and more elaborate tests than me.

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @06:43PM (#5641311)
As mentioned below, there is that official upgrade guide. It is not comprehensive, as mentioned in the post. Should get you going, though. We'll be continuing to work on it now that there's an RC out.

I personally have reviewed (but am not getting a cut of) http://www.upgradingtorails4.com/ and it's pretty good.

Re:Rails 4.0: Release Candidate 1 released by elektronaut on Wednesday May 01, 2013 @06:39PM (#5641291)
Re:Rails 4.0: Release Candidate 1 released by ninthfrank07 on Wednesday May 01, 2013 @06:55PM (#5641363)
I highly recommend watching these free videos from Code School: http://rails4.codeschool.com/videos.
Re:Rails 4.0: Release Candidate 1 released by elektronaut on Wednesday May 01, 2013 @10:26PM (#5642125)
692 examples, 0 failures, on both 1.9.3 and 2.0.

This was the smoothest major upgrade yet, with very helpful deprecation notices. Thanks for all the hard work.

Re:Rails 4.0: Release Candidate 1 released by josephlord on Thursday May 02, 2013 @06:00AM (#5643490)
I had many failures when I just updated rails (from an edge version a couple of weeks old) to rc1. When I did a full bundle update it picked up the latest rspec-rails (2.13.1 instead of 2.13.0) and everything passed again.

The errors were I think caused by a change in the separation of the tests so database state was leaking between them causing failures but I haven't investigated deeply.

In these sorts of situations I never know whether it is best to 'bundle update' everything and have less information about the source of any problems or just to 'bundle update rails' and not receive the compatibility fixes straight away. How do others do this?

[Edited to add detailed version information and last paragraph].

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Thursday May 02, 2013 @10:31AM (#5644662)
In rspec-rails' case, that's because an error was caught after the beta1 release, and 2.13.1 introduced the fix.

Generally, I do this:

1) update everything, run `rake rails:update`, and run the tests. Hope this works. If not, figure out if the error is mine or a gem's.

2) If it's a gem's, try to lock it to the exact version I was using and repeat 1).

3) If that doesn't work due to version issues, investigate if the gem has some sort of preview support for rails 4.

4) if not, either send a pull request or an issue.

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @10:40PM (#5642177)
Awesome. Glad to hear it. Thanks for giving it an early run.
Re:Rails 4.0: Release Candidate 1 released by marcamillion on Wednesday May 01, 2013 @09:21PM (#5641934)
How do the major gems play with this RC? Namely Devise, CanCan, etc.? I was going to play with the beta, but I think I saw some potential integration issues with Devise and I decided it wasn't worth the trouble.
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @09:42PM (#5641985)
Most of the biggest ones have been working for a while, or have a branch where they're working in support.

I think this is one of the biggest advantages of Travis' uptake in the Ruby world, actually: it's really easy to test your gem against Rails master and put it in allow_failures, which means you can know if your gem is compatible, and occasionally show when a new commit introduces an incompatibility.

If you find any gems that don't work, please ping me and I'll investigate and send PRs; this is one of the advantages of my employer (Jumpstart Lab) paying for OSS work. The whole Ruby world wins. :)

Re:Rails 4.0: Release Candidate 1 released by marcamillion on Wednesday May 01, 2013 @10:40PM (#5642174)
Interesting. Thanks...will do :)
Re:Rails 4.0: Release Candidate 1 released by rafaelfranca on Wednesday May 01, 2013 @09:35PM (#5641973)
Devise already has a rails4 branch with support to Rails 4 and we are planning to do a beta release soon
Re:Rails 4.0: Release Candidate 1 released by marcamillion on Wednesday May 01, 2013 @10:40PM (#5642176)
Never noticed that...thanks!
Re:Rails 4.0: Release Candidate 1 released by DanielRibeiro on Wednesday May 01, 2013 @07:41PM (#5641541)
How can I see if the issue[1] that caused GitHub tons of issue[2] was fixed on this RC?

[1] https://github.com/rails/rails/issues/9813

[2] https://github.com/blog/1440-today-s-email-incident

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @07:55PM (#5641597)
Here's how, normally:

1) You take the commit referenced, like this: https://github.com/rails/rails/commit/f980289fd2c1b9073a94b5...

2) Right below the title, GitHub shows you which branches the commit is in. As you can see with that commit (the one that caused the problem), it's only in 3-2-stable. Therefore, not being in master, it wasn't ever in Rails 4, only in Rails 3.2.

Since this was a security issue, it's possible that the commit was different for Rails 4. So we load up the page for the referenced CVE (cve-2013-1854): http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1854

That page links to the announcement email: https://groups.google.com/group/ruby-security-ann/msg/34e0d7...

The announcement email discusses which versions were affected:

> Versions Affected: 3.2.x, 3.1.x, 2.3.x

But, since Rails 4 wasn't yet released, it wouldn't be there.

To be 100% sure, you can grab a copy of the source, and grep the git log for the CVE number. That brings up this commit: https://github.com/rails/rails/commit/2392535f4085d88186097e...

This commit is in master and v4.0.0rc1, as GitHub shows.

I am not mega super updated on the status of this issue, as I'm not on the security team, but given that it's still open and marked as 'regression,' I would not be sure that this was fixed.

That said, this particular bug is a complex interaction between components, and people haven't mentioned if it affects master or not. Therefore it's possible that even though the fix didn't make it into 3-2-stable yet, it may not have affected master.

So, at the end of all that, I guess the answer is "I'm not 100% sure, I'd ping tenderlove," but I hope that helps you identify which commits have made it into which releases in the future.

Re:Rails 4.0: Release Candidate 1 released by DanielRibeiro on Wednesday May 01, 2013 @08:47PM (#5641809)
Thanks Steven! I'll look into it. And thanks for all the great work you've been putting on Rails.
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @08:55PM (#5641849)
<3
Re:Rails 4.0: Release Candidate 1 released by siong1987 on Wednesday May 01, 2013 @11:16PM (#5642296)
Do you use PostgreSQL with your app on Heroku? I seem to run into problem with it: https://github.com/heroku/heroku-buildpack-ruby/pull/93
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @11:20PM (#5642308)
I did, yes, but I didn't have that issue.
Re:Rails 4.0: Release Candidate 1 released by siong1987 on Wednesday May 01, 2013 @11:50PM (#5642392)
Weird. Now, I have to manually configure my database.yml in order to make it work on Heroku. Btw, I upgraded from 4.0.0.beta1 to 4.0.0.rc1.

4.0.0.beta1 works fine on Heroku but I keep running into ActiveRecord problem after upgrading to 4.0.0.rc1.

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Thursday May 02, 2013 @12:11AM (#5642478)
I made this app fresh on rc1, so theoretically that's the difference. Steveklabnik/attendr is the repo if you want to poke at it.
Re:Rails 4.0: Release Candidate 1 released by mpd on Wednesday May 01, 2013 @07:17PM (#5641448)
The issue I keep running into when testing the RCs with larger apps is the number of gems that have strict dependencies on older versions of activesupport, etc.

I am wading through my Gemfile (over 200 gems counting direct and indirect dependencies) at the moment trying to give the RC a shot, but it's going to be difficult to justify spending much more time on it, unfortunately.

Re:Rails 4.0: Release Candidate 1 released by zachgersh on Wednesday May 01, 2013 @09:03PM (#5641877)
Why not post your whole gemfile as a gist? People in the HN community could definitely go through and start to check some of the dependencies for you :)
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @07:27PM (#5641484)
Can you tell me which gems you're having problems with? I'll send a bunch of pull requests this evening.
Re:Rails 4.0: Release Candidate 1 released by mpd on Wednesday May 01, 2013 @07:45PM (#5641560)
Sure - so far I've had to update postgres_ext, rails_autolink, redis-rails (part of redis-store package), and marginalia.

I'm currently fighting with redis-rails in particular, as bundler doesn't seem to be seeing the dependency change in a nested gem.

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Wednesday May 01, 2013 @07:57PM (#5641602)
Word. I'll try to look into it; I'm about to go get some dinner, but I should have some time tonight or tomorrow.
Re:Rails 4.0: Release Candidate 1 released by phsr on Thursday May 02, 2013 @06:03PM (#5647465)
What features are you using postgres_ext for? A lot of the ActiveRecord datatypes support is handled by Rails 4.0 (arrays, uuid, ranges, inet/cidr and macaddr are in Rails 4.0). I want to submit some pull requests to Arel to add support for some of the datatype operators

PS: I am the postgres_ext maintainer

Re:Rails 4.0: Release Candidate 1 released by bcardarella on Thursday May 02, 2013 @06:05PM (#5647479)
In the case of postgres_ext you should actually check to make sure the functionality you need isn't already in Rails 4. Dan McClain extracted much of what he did and got it pulled in.
Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Thursday May 02, 2013 @05:02PM (#5647201)
Hey mpd,

I did some work on this today, would you mind sending me an email so we can discuss it? [email protected]

Re:Rails 4.0: Release Candidate 1 released by shimms on Wednesday May 01, 2013 @10:58PM (#5642235)
schema_plus (https://github.com/lomba/schema_plus) is having issues with ActiveRecord changes (API changes, methods not existing any more that they remove/overwrite etc).

I had a look at it and got through a bit of re-working some of the changes (indexes etc), but got pretty quickly out of my depth of understanding around the inner workings of ActiveRecord.

Re:Rails 4.0: Release Candidate 1 released by steveklabnik on Thursday May 02, 2013 @05:03PM (#5647206)
AR is my least-understood part of Rails, but I'll give it a look.