11 ms·
Rails 4.0: Final version released
- deleted 13y ago[deleted]
- jazearbrooks 13y agoI've been looking forward to this for a long time. Congrats to the Rails team! Now I just need a good book on Rails 4.0 or for Michael Hartl to update the Rails tutorial.
- heidar 13y agoHe has already updated it, not sure if it is the final version yet: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=4.0 http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?ve...
- jazearbrooks 13y agoYea I've seen that but I don't want to start until I know it accounts for the final version of 4.0. When he first released it for 4.0 beta, there were major inconsistencies between that and one of the release candidates.
- jherdman 13y agoHave you considered "The Rails 4 Way"?
- jazearbrooks 13y agoWhen it's finished, I'm a fan of Rails 3 Way
- jwarren 13y agoI've been going through the Rails 4.0 beta book over the past week or two. I'm just over 50% of the way through and have done all the optional exercises too. So far, I've not found a single problem.
- jpdoctor 13y agoUg. We have a new website that is coming out in about a month. Enough mileage on 3.2 that it's too painful to consider delaying, but hate the thought of doing the upgrade later. Would love opinions from the HN gallery as to whether a delay now saves time later. Edit: And thanks to the Rails team for providing me with this conundrum! Edit2: Thanks for the info and opinions! I'll check back later too.
- thibaut_barrere 13y agoI did a git branch for my app (https://www.wisecashhq.com/ https://www.wisecashhq.com/) - in 3 hours or so I was able to pass the tests and run the app properly. For larger apps (which I maintain as a freelance) I would wait a bit more though, since some gems will still have little bugfixes related to Rails 4 compatibility, most likely.
- jeremymcanally 13y agoThe upgrade isn't that bad. Nowhere near going 2.x to 3.x.
- thibaut_barrere 13y agoI definitely agree, this is a lot less difficult.
- dkrich 13y agoThis would in many ways seem to suggest a less urgent need to upgrade from 3 to 4 than there was from 2 to 3 though. It seems like a major focus of 4 was speeding up client/server interactions. If that's not a major concern, I don't necessarily think it's something to lose sleep over in the near term. I'm in the same boat (having been building on Rails 3 for a good while) and for now I'm going to stay put. People who are more knowledgeable about the specific updates please correct me if my assumptions are off-base.
- thibaut_barrere 13y ago
- ciniglio 13y agoHas anyone read any of the books mentioned in the link (or Rails 4 in Action)? Any recommendations for someone that is intermediate in Rails 3, but would like to become more advanced?
- owenjones 13y agoThe Rails 3/4 Way by Obie Fernandez was really helpful to me. It's more of a cookbook or reference guide that really deep dives into each aspect of Rails. Definitely not a good choice for 1st Rails book though. Another recommendation for it below from jherdman & jazearbrooks.
- hipsters_unite 13y agoThe Rails 3 Way was the book that cracked it for me. Hartl's tutorial is a great start, but Obie's was the book that actually hit the 'why' on the head.
- benwoody 13y agoI've used Rails 4 in Action. It's in beta right now and definitely has a few problems. However, I believe Steve Klabnik has recently taken over updating the book, so hopefully things will start to come together soon.
- steveklabnik 13y agoYup! I'm in charge these days. I've updated the first half of the book, though the forums say there's still a few typos and such that made it through so far. I'm working on the second half now.
- matthewrudy 13y agoI've read the updated chapters. Love it so far. It'll be interesting to see how if and how you introduce concerns. So far I've seen no best practices on this. Just an empty directory created.
- obiefernandez 13y agoIt's always an uphill battle for us (Addison Wesley Professional Ruby Series) to get official recognition from DHH since we're not part of the pragprog clique. The latest rewrite of my book for Rails 4 is available at http://leanpub.com/tr4w http://leanpub.com/tr4w Michael Hartl's Rails Tutorial has also been fully updated. See http://news.railstutorial.org/ruby-on-rails-tutorial-rails-4-beta/ http://news.railstutorial.org/ruby-on-rails-tutorial-rails-4... for all links to relevant material.
- cobrabyte 13y agoThat's unfortunate because, of all the Rails books I've purchased through the years, yours and Hartl's are the best for my particular learning style. Doubt it's just me...
- obiefernandez 13y agoIt's not just you. Our sales are very strong and growing year on year. I'm very happy with the perfoance of the series. Sandy Metz's new book is getting rave reviews everywhere.
- jerhinesmith 13y agoI just finished Sandy Metz's book, and it is fantastic. Easily one of the best ruby books I've read; I can't recommend it enough.
- zachgersh 13y agoWhat is her new book? I am assuming you mean the next book after POODR?
- mhartl 13y agoNo, he's referring to POODR, which is "new" in the sense that it's been released recently compared to books like The Rails Way and the Ruby on Rails Tutorial.
- 13y ago
- VeejayRampay 13y agoThanks to all the committers and releasers involved. The countdown to Rails 5 has begun :D
- johnbellone 13y ago4.1 :)
- usethis 13y agoThis is an awesome achievement. There are so many improvements to this version that are not immediately visible, but which are maturing Rails in tremendous ways. I think it compares with the release of Mac OS X Snow Leopard (10.6). Especially in the perception on different types of users (experts to consumers). On a different note, moving from 3.2 can best be done one gem at the time. For instance, implement strong parameters and you're one step closer to Rails 4. https://github.com/rails/strong_parameters https://github.com/rails/strong_parameters
- rubiquity 13y agoDarn. I bought Crafting Rails Applications in paperback three months ago :( On another note, I've been using Rails4 beta and RCs at home for the past couple months and it has been a joy. At work I've also been working on a Rails 3.2 app and incorporating routing_concerns and strong_parameter gems. I think upgrading from Rails 3 to 4 apps won't be as drastic as upgrading from Rails 2.x to 3 apps was (curse you asset pipeline!)
- hackerboos 13y agoThere's a new edition of that out November: http://pragprog.com/book/jvrails2/crafting-rails-4-applications http://pragprog.com/book/jvrails2/crafting-rails-4-applicati...
- bti 13y agoMaybe a little off topic... I just started a small project using Angular and Rails, learning both from scratch as I go. I am using Rails as a purely JSON server and handling all the templates in Angular and doing requests over $http. Is it worth using Angular just for the UI niceness and using more of Rails? I need things like authentication and sessions but at its roots it is a single page app. Would any of this new Rails 4 turbolinks stuff help?
- vinceguidry 13y agoIf you want to learn Rails, you should choose a project that will teach you Rails. If all you're going to do with it is serve up JSON, then you're not really going to learn anything and will needlessly overcomplicate your app. Just use something like Sinatra in this case, Sinatra will get out of your way and allow you to focus on the front-end. Using Angular with Rails is definitely a Good Thing(TM), but you really need a large enough project to justify, something both front- and back-end heavy. My current project is large enough to benefit from both, but unfortunately, I chose jQuery and Sinatra. Feeling the pain, for sure.
- steveklabnik 13y agoThere is waaaay more to Rails than the view layer. If 'all you're going to do is serve up JSON', then you'll be using a very large amount of Rails: https://github.com/rails-api/rails-api#why-use-rails-for-json-apis https://github.com/rails-api/rails-api#why-use-rails-for-jso...
- vinceguidry 13y agoHmm. Thanks for this.
- steveklabnik 13y agoThe Rails-API project is here to help! http://github.com/rails-api/rails-api http://github.com/rails-api/rails-api I don't personally know of anyone using Angular + Turbolinks, so I can't answer that.
- Legion 13y agoTrying to download the latest Agile Web Dev w/Rails from PragProg and just get the error, "File is not ready yet". On two separate accounts. Also, this post describes today's book release as the "final" version, but the PragProg changelog calls it Beta 4.0.
- angersock 13y agoAfter looking over the changelog and doing a little research: it seems like this Turbolinks thing is now default-on for Rails 4. This screws up the normal .ready() stuff, right? Has this bitten anyone yet?
- steveklabnik 13y agoYes, Turbolinks is included by default, but it's really easy to not use if you don't want to: http://blog.steveklabnik.com/posts/2013-06-25-removing-turbolinks-from-rails-4 http://blog.steveklabnik.com/posts/2013-06-25-removing-turbo...
- angersock 13y agoRight, this is good--but are fears of mysteriously-breaking javascript depending on the ready event unfounded?
- steveklabnik 13y agoBy 'the ready event' I'm assuming you mean the onload event. Those will break, you need to update them to listen to the 'page:ready' event instead. The Turbolinks README has everything you need to do to make your applications ready, if you choose to use it: https://github.com/rails/turbolinks#turbolinks https://github.com/rails/turbolinks#turbolinks
- breckenedge 13y agoIf you're using jquery, then there is already a gem for that: jquery-turbolinks (https://github.com/kossnocorp/jquery.turbolinks https://github.com/kossnocorp/jquery.turbolinks)
- mieko 13y agojquery-turbolinks as a drop-in fix worked great for my application. The only tweaks my own code required at that point were resources I assumed would die and be recreated on the next page load, like doubling up setInterval handles in domready.
- danso 13y agoSo...what have people's experience been in trying to have fat-client-like speed with TurboLinks? Not necessarily with Rails 4.0, but in general? I imagine for some Rails users, the decision is not just whether to go from 2.x/3.x to 4, but whether to go to Sinatra + Backbone/Angular/Ember/etc
- masomenos 13y agoEven if your UI is all in JS, Rails still saves a ton of work as an API server compared to Sinatra.
- vectorpush 13y agoAny examples? My experience with Rails and Sinatra on a daily basis for the last two years has proven the exact opposite.
- steveklabnik 13y agohttps://github.com/rails-api/rails-api#why-use-rails-for-json-apis https://github.com/rails-api/rails-api#why-use-rails-for-jso...
- malyk 13y agoThat's definitely a decent list, but the problem for me is that you are also forced to have EVERYTHING ELSE! It's all nicely required in the for you in your app and there aren't straightforward ways to remove 90% of the stuff you don't want. I work with rails every day for the last 6+ years and it was a revelation when I started. Now I still think it works decently well for large web-apps, but it's just grown way to big over the years. Basecamp is awesome and a great proving ground, but I'd wager the vast majority of apps written in RoR come no where close to needing most of what's included today.
- marknutter 13y agoI'm curious as to why having that stuff available is a bad thing?
- ahawkins 13y agoIs there anything else Rails can do? I can only think of a unified queuing API (which was scheduled by dropped from this release). Has Rails reached feature completeness?
- steveklabnik 13y agoFukuyama, is that you? http://en.wikipedia.org/wiki/The_End_of_History_and_the_Last_Man http://en.wikipedia.org/wiki/The_End_of_History_and_the_Last...
- VeejayRampay 13y agoTry doing WebSockets in a Rails app for example. Rails was born in an age of request/response and sometimes it shows. And I say that as a Rails enthusiast.
- ahawkins 13y agoYa. I'd like to see better support for that. The problem is the ruby/javascript bridge.
- throwaway420 13y agoCongrats to the team on a great release. I'm curious how does this affect the rails-api project?
- steveklabnik 13y agoIt should work today, as we've been tracking edge Rails for a while. If it does not, that's a bug. Please file an issue if you find anything.
- vysakh0 13y agoIs it only me or anyone else facing issue installing the gem? Getting this error ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) no such name (https://rubygems.org/gems/actionpack-4.0.0.gem https://rubygems.org/gems/actionpack-4.0.0.gem) Edit: Now it is working :)
- steveklabnik 13y agoI am so excited, as this is the first major release that I've contributed to! Thank you so much to all the other people who've put this release together, I really do think this is the best Rails yet! http://contributors.rubyonrails.org/releases/4-0-0/contributors http://contributors.rubyonrails.org/releases/4-0-0/contribut... I mentioned this below, but I'll mention it here, as well: if you have gems that aren't ready yet for Rails 4, please ping me and let me know if I can help get them ready somehow. If you maintain a gem and want help running your tests on Travis against multiple versions of Rails, I can help with that as well. <3 <3 <3 <3
- rzendacott 13y agoCongratulations! That's truly awesome. Any tips for a novice developer who would love to start contributing?
- steveklabnik 13y agoThank you! I started less than a year ago, and I was the #13th biggest contributor here, and received a commit bit a few weeks ago. It's not too hard to get involved if you'd like! I wrote up my own personal 'contributing to Rails' guide here: http://blog.steveklabnik.com/posts/2012-07-05-how-can-i-contribute-to-ruby-on-rails- http://blog.steveklabnik.com/posts/2012-07-05-how-can-i-cont... The official one is here: http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html http://edgeguides.rubyonrails.org/contributing_to_ruby_on_ra... The easiest way is to write documentation; that's how I got started. It's not for everyone, though. The simplest possible way to get involved with writing code is to pick an open bug on the tracker and fix it. Like most things, it just gets easier the more you do it. The first one seems hard, everything seems confusing. But by the time you've done two or three, you wonder why you ever thought it was difficult.
- zachgersh 13y agoLOL. Meeting of the minds with my comment above :)
- 13y ago
- zachgersh 13y agoHas anyone actually had a go with the threading as of yet? I'd love to actually see some performance #s!
- pimeys 13y agoWe're running some of our applications with threaded 3.2 and Passenger. Not the easiest job to convert your app, but in some cases really worth the trouble.
- ndcrandall 13y agoI have been using 4.0.0.rc1 for about a month now and have enjoyed the process. There have been a lot of great updates since the previous versions. I will caution all to be aware of the turbolinks included by default. I spent a while scratching my head why a setTimeout function worked every so often. I had no prior experience with turbolinks or the discussion thereof, though I believe it's a great feature.
- dfischer 13y agoGreat work guys. It shows.
- oelmekki 13y agoThe russian doll cache looks awesome, but I'm a bit worried about this bit in dhh's explanatory article : > The beauty of that system is that you just don’t care. Memcached will automatically evict the oldest keys first when it runs out of space Well, I do care : I use redis as cache backend. I guess it will not be as simple as that.
- oelmekki 13y agoTo answer myself : it's possible to use a maxmemory-policy=volatile-ttl directive to tell redis to remove older keys. Problem is, it's not reliable at all : it will actually take a bunch of unpredictable keys and remove the oldest in the set. http://stackoverflow.com/questions/9010789/configuring-redis-to-consistently-evict-older-data-first http://stackoverflow.com/questions/9010789/configuring-redis... I currently empty redis cache on each deployment, so that's not really a problem, but it will be when I use a less naive cache invalidation on code update (and I'm pretty sure some of you are). So, we'll probably have to take a look in rails cache internal and force sweeping when computing a new key (this will not be a major problem on redis, since it supports wildcards in key names).
- elsurudo 13y agoJust wanted to point out this great resource for upgrading: http://railsdiff.org http://railsdiff.org It diffs the initial 'rails new' project between any two versions.
- revskill 13y agoA question: Could someone tell me which types of application does Rails 4.0 solve, but the older versions couldn't ? In general, which types of application could not be solved by Rails 4 ? Thank you.
- pkroll 13y agoI'm basing this on what I've read, and my experience with Rails 3, so take it with a grain of salt. The type of application you couldn't do in the older one? Easy single-page apps. Of course you COULD do it, writing your own JavaScript or CoffeeScript. But Turbolinks and the Russian Doll caching give Rails 4 a way to get much of the speed of those custom-written apps and yet stay in Ruby/Rails. I don't know of any type of application that Rails 4 CAN'T do, but it's still Rails and Ruby, so anything computationally intense would probably be better served (ha!) by a Java (or Go, or Scala, or...) framework. The further you get from a CRUD app, the less useful the Rails framework becomes.