Rails 3.0: Third beta release

Posted by David April 13, 2010 @ 07:35 PM

We’re marching towards the release candidates with hurried steps, but along the way we stopped by for another beta. This one spins out a few overdue extractions into plugins (see http://github.com/rails/verification and http://github.com/rails/dynamic_form), fixes a security issue with cookies, crosses a few t’s and dots a few i’s. Upgrading from beta 2 is recommended.

As always, you can install the latest beta with gem install rails --pre.

We’ll see you again soon for the release candidate.

67 comments

Comments

  1. Vojto on 13 Apr 19:42:

    Good job! Can’t wait for RC.

  2. Eric Koslow on 13 Apr 19:46:

    Wow awesome work guys. Fastest update yet.

  3. Brian Cardarella on 13 Apr 19:46:

    How is the 1.9 support for this? Do we still need to use 1.9.2-head?

  4. Brian Cardarella on 13 Apr 19:46:

    How is the 1.9 support for this? Do we still need to use 1.9.2-head?

  5. Stuart on 13 Apr 19:51:

    I’m getting a no such file to load—rails/cli error after upgrading from beta 2 to 3. Any tips?

  6. Michael Johann on 13 Apr 19:54:

    So, I guess we will see a final Rails 3.0 for railsconf?

  7. Kyle on 13 Apr 20:03:

    Awesome. Please forgive my ignorance, but will installing the Rails3 beta nuke my working Rails2 version?

  8. Mark Carey on 13 Apr 20:08:

    Kyle, you might want to look into using rvm if for no other reason than gemsets: http://rvm.beginrescueend.com/gemsets/basics/

  9. Greg Moreno on 13 Apr 20:14:

    Kyle, I highly recommend using rvm. You can have different versions of ruby and sets of gems in your machine.

  10. lacasa@linga.it on 13 Apr 20:15:

    Due etti di prosciutto tagliato fine, grazie

  11. Shannon on 13 Apr 21:31:

    Stuart did you get past the rails/cli error?

  12. Micah Geisel on 13 Apr 21:32:

    I see that the extracted dynamic_forms plugin provides #error_messages_for and #error_messages_on. I can’t imagine that this functionality would be missing from rails core, so is there a new way to display form error messages in rails 3?

  13. Greg Moreno on 13 Apr 21:47:

    Stuart, Shannon

    Regarding the rails/cli error, I uninstalled both beta2 and beta3. Then, installed beta3

  14. Greg Moreno on 13 Apr 21:47:

    Stuart, Shannon

    Regarding the rails/cli error, I uninstalled both beta2 and beta3. Then, installed beta3

  15. Shannon on 13 Apr 21:58:

    Ah, thanks Greg :)

  16. Ron Green on 13 Apr 22:12:

    Uninstall all versions of rails. Install Beta 3. Ran Rails -v Output:

    no such file to load—rails/cli (LoadError) from /usr/local/lib/ruby/gems/1.9.1/gems/rails-3.0.0.beta3/bin/rails:1:in `<top>‘ from /usr/local/bin/rails:19:in `load’ from /usr/local/bin/rails:19:in `<main>‘

  17. Gerardo Lisboa on 13 Apr 22:13:

    OS X 10.5:

    gem install rvm OK rvm update OK

    rvm 1.8.7 OK gem install rails—pre OK

    rvm 1.9.2 OK gem install rails—pre OK

    Now the fun begins ;)

  18. Joe The Plumber on 13 Apr 22:24:

    Does this work with 1.8.7 p248?

  19. BillSaysThis on 13 Apr 22:33:

    I’m in the same boat as Ron Green, uggh.

  20. Kris Brown on 13 Apr 22:48:

    If you get the LoadError for rails/cli try a gem clean. Looks like the rails binary moved between beta2 and beta3 and this can cause some headaches if both versions are around.

    See http://github.com/rails/rails/commit/a64bfc3c8e2a62b39f3cf8497c2a5a82272bd27a

  21. Jarrod on 13 Apr 22:52:

    Running gem clean worked. Thanks.

  22. Ron Green on 13 Apr 22:57:

    Now I’m getting

    ERROR: While executing gem … (Errno::ENOENT) No such file or directory – lib

    But the Cli error is gone after running “Gem Cleanup”.

  23. BillSaysThis on 13 Apr 23:25:

    Kris Brown: Thanks!

    Still getting an error, but at runtime not startup:

    Error during failsafe response: ActionView::Template::Error (wrong number of arguments (0 for 1)) in /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb:

    Started GET ”/” for 127.0.0.1 at 2010-04-13 16:22:53

    ArgumentError (wrong number of arguments (0 for 1)):

    Rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.8ms)

  24. Jones Lee on 13 Apr 23:32:

    gem clean for whom who get cli error

  25. WT on 14 Apr 00:48:

    No release notes this time?

  26. Blue on 14 Apr 01:11:

    Wait – why are these being extracted to plugins?

  27. omarvelous on 14 Apr 02:51:

    Congrats! Yall really fudge up my routes!! I was like the :as option, until now! I’ll adjust! Thanks again guys for the great work!

  28. Bobby on 14 Apr 02:59:

    Anybody else have all of their error messages disappear after installing the dynamic_form plugin and upgrading to rails 3 beta 3? My fields highlight to show the error, but the text actually saying what the error is never appears…

  29. Drew on 14 Apr 03:00:

    Jones,

    Thanks. That worked great.

  30. Bobby on 14 Apr 03:34:

    Nevermind, I dropped in the code that’s generated now by the scaffolding for showing errors and it’s working now, but with a lot more code in my view.

  31. Alan Maciel on 14 Apr 04:20:

    awesome I’m just waiting for the RC to start a new project for a client!

  32. Steve Wong on 14 Apr 04:31:

    Kris,

    Thanks. It works now after running gem clean.

  33. Sabio on 14 Apr 05:03:

    Getting the same error message as Ron

    Any idea to solve it?

  34. Sohan on 14 Apr 05:44:

    I have linked this post at the Drink Rails blog.

  35. Tuxie on 14 Apr 07:18:

    What is the new preferred way to display form error messages?

  36. Ollie on 14 Apr 07:34:

    Go Rails!

  37. Alastair Brunton on 14 Apr 08:31:

    Seems strange that error_messages_for is no longer in rails core, this is used for a lot of form interaction!

    Is there another way to do it in Rails 3?

  38. m/b on 14 Apr 09:57:

    hum, i installed dynamic_forms plugin, but the deprecation warning still appears… anyone else with this problem?

  39. Chris on 14 Apr 11:23:

    Can somebody confirm that error_messages_for is no longer in the core? I use this all the time so It seems strange to remove it. I find it hard to believe that they would remove it. It’s one of those things that makes rails so nice to use, it lowers the entry level, and made me love rails when I first tried it.

  40. Christian Seiler on 14 Apr 12:14:

    A little elaboration on why the form stuff was removed from core would help a lot.

  41. Andrea on 14 Apr 12:39:

    Me too, i would like to know why dynamic_form was removed…

  42. john T on 14 Apr 12:54:

    @Brian Cardarella and anyone else:

    At least on Windows, Ruby 1.9.1 crashes hard even while trying to run a simple, scaffold test.

    “Faulting application ruby.exe, version 1.9.1.0, faulting module msvcrt-ruby191.dll, version 1.9.1.0, fault address 0×000e70ee.”

    ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

  43. John T on 14 Apr 13:49:

    Did I miss some release note somewhere? I used to be able to, from the Rails console, get paths and urls using:

    app.posts_path or app.post_path(p)

    Now, trying to do that, I get an error stating that those methods are protected?

    irb(main):001:0> app.posts_path NoMethodError: protected method `posts_path’ called for #<actiondispatch::integration::session:0x3bf67c0>

    (Win. Rails 3beta3, Ruby 1.9.1p378)

  44. James E on 14 Apr 19:15:

    Re: the removal of error_messages_for, etc. I’m not sure, but maybe you can still use:

    <% form_for @post do |f| %> <%= f.error_messages %> <% end %>

  45. James E on 14 Apr 19:21:

    Looks like error_messages_for and others were replaced with less magic (yay!):

    http://github.com/rails/rails/blob/26e05efdb6c29430c5d282870b1e236dff8465c9/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb

  46. James E on 14 Apr 19:26:

    See also regarding their removal: http://news.ycombinator.com/item?id=1263775

  47. Jari Jokinen on 15 Apr 09:19:

    I absolutely agree with DHH: “The error_messages_for included both fixed copywriting, HTML structure, and relied on CSS. Ugh, bad shit.”

    I’m sure nobody will miss it.

    Remember that you can always write your own error_messages_for helper method or use the dynamic_form plugin.

  48. d4ny1 on 15 Apr 10:10:

    Getting the same error message as Ron Successfully installed rails-3.0.0.beta3 1 gem installed Installing ri documentation for rails-3.0.0.beta3… ERROR: While executing gem … (Errno::ENOENT) No such file or directory – lib

    then I run rails -v Could not find gem ‘rails (= 3.0.0.beta2, runtime)’ in the gems avai lable on this machine. (Bundler::GemNotFound)

    Any idea?

  49. Jari Jokinen on 15 Apr 13:15:

    @d4ny1: Like the error message says, you are trying to load Rails 3 beta 2 gem, which is not found.

    Make sure you have this in your Gemfile:

    gem "rails", "3.0.0.beta3"
  50. Rails sucks on 15 Apr 17:07:

    Rails sucks, Ramaze is the way.

  51. hiroshi on 16 Apr 08:38:

    Regarding the rails/cli error, try script/rails instead of rails command.

  52. adhd360 on 18 Apr 04:07:

    <%= f.error_messages %> does not work either

  53. peter on 18 Apr 14:05:

    @adhd360 Look at comments 45 and 46.

    For a “form_for @book …” that errors should be at ”@book.errors” with ”@book.errors.full_messages”

    Haven’t tried it myself though.

  54. bhavinkamani@gmail.com on 19 Apr 12:12:

    Installed dynamic_form plugin as per the error message under vendor/plugins dir. Still form() or error_messages_for is not getting picked up from the plugins dir. In the log – no error messages, only deprecated warnings. Am I missing anything in the plugin install?

  55. Tim on 19 Apr 18:58:

    Experiencing the same problem as bhavinkamani. The plugin is installed and there are still plugin installation notices and no error_messages_for work.

  56. Paul on 21 Apr 19:09:

    How should deploying to a subfolder be handled? Previous versions of rails used relative_url_root, but I noticed the following:

    deprecated_config_accessor :relative_url_root, “relative_url_root is ineffective. Please stop using it”

  57. ADMIN mag on 22 Apr 16:01:

    to fix the problem with “no such file or directory – lib” you just need to create said directory, that is

    “sudo mkdir /opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-3.0.0.beta3/lib”

    when you installed ruby 1.9 with macports. if you didn’t you can use “dtruss” on the gem installation to find the missing directory

  58. JM on 23 Apr 00:26:

    Same pb as Stuart after a simple “rails -v” :

    “bin/rails:1:in `require’: no such file to load—rails/cli “

    gem clean didn’t solve it I use RVM 0.1.28 and Ruby 1.9.1p378 on Ubuntu 9.10 I never installed the beta 2 before but I do have ruby 1.8.7 and rails 2.2.3-1 installed in a separated RVM environment

    Any idea?

  59. AN on 23 Apr 01:00:

    Same error as ADMIN mag rails an$ gem install rails—pre Successfully installed rails-3.0.0.beta3 1 gem installed Installing ri documentation for rails-3.0.0.beta3… ERROR: While executing gem … (Errno::ENOENT) No such file or directory – lib

  60. alexander.lomakin@gmail.com on 23 Apr 04:22:

    Cool! It’s too close to stable release!

  61. Pawel on 23 Apr 10:16:

    to fix the error from ANs comment (59)

    just create lib dir

    /usr/local/lib/ruby1.9/gems/1.9.1/gems/rails-3.0.0.beta3/lib

    nad rerun the install :)

  62. Bobby on 23 Apr 18:00:

    For those with the deprecation errors with the dynamic_form plugin read here for more info: https://rails.lighthouseapp.com/projects/8994/tickets/1484-deprecate-error_messages_for

    Seems to be some conflicts with HAML and other plugins.

  63. sean lynch on 23 Apr 20:59:

    If you get the lib message on debian based linux try:

    ” sudo mkdir /usr/lib/ruby/gems/1.8/gems/rails-3.0.0.beta3/lib”

    or

    ” sudo mkdir /usr/lib/ruby/gems/1.9/gems/rails-3.0.0.beta3/lib”

    change your ruby version # as appropriate.

  64. Greg Donald on 24 Apr 00:25:

    How about PostgreSQL support?

    http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/6b3798ea1d92f8d3

  65. JM on 24 Apr 01:08:

    Thank you Pawel and sean lynch, the lib dir did the trick! :)

  66. PORTX on 03 May 22:47:

    If you having issues with installing this or any outher gems with rvm (your getting the Errno::ENOENT) make shure you have a folder in your gems/version directroy

  67. Shawn on 04 May 21:34:

    Hi,

    I’ve been cruising along enjoying all the new goodness while porting an existing app, that is until hitting Ajax requirements – specifically form_remote_for, link_to_remote, etc.

    I understand the change from form_remote_for to form_for :remote => true but am having an extremely difficult time getting around the lack of support for things like :complete, :before, :success, etc.

    Are there plans to incorporate these options on the updated functions related to making ajax calls?

    Thanks,

    Shawn