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.

Good job! Can’t wait for RC.
Wow awesome work guys. Fastest update yet.
How is the 1.9 support for this? Do we still need to use 1.9.2-head?
How is the 1.9 support for this? Do we still need to use 1.9.2-head?
I’m getting a no such file to load—rails/cli error after upgrading from beta 2 to 3. Any tips?
So, I guess we will see a final Rails 3.0 for railsconf?
Awesome. Please forgive my ignorance, but will installing the Rails3 beta nuke my working Rails2 version?
Kyle, you might want to look into using rvm if for no other reason than gemsets: http://rvm.beginrescueend.com/gemsets/basics/
Kyle, I highly recommend using rvm. You can have different versions of ruby and sets of gems in your machine.
Due etti di prosciutto tagliato fine, grazie
Stuart did you get past the rails/cli error?
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?
Stuart, Shannon
Regarding the rails/cli error, I uninstalled both beta2 and beta3. Then, installed beta3
Stuart, Shannon
Regarding the rails/cli error, I uninstalled both beta2 and beta3. Then, installed beta3
Ah, thanks Greg :)
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>‘
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 ;)
Does this work with 1.8.7 p248?
I’m in the same boat as Ron Green, uggh.
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
Running gem clean worked. Thanks.
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”.
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)
gem clean for whom who get cli error
No release notes this time?
Wait – why are these being extracted to plugins?
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!
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…
Jones,
Thanks. That worked great.
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.
awesome I’m just waiting for the RC to start a new project for a client!
Kris,
Thanks. It works now after running gem clean.
Getting the same error message as Ron
Any idea to solve it?
I have linked this post at the Drink Rails blog.
What is the new preferred way to display form error messages?
Go Rails!
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?
hum, i installed dynamic_forms plugin, but the deprecation warning still appears… anyone else with this problem?
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.
A little elaboration on why the form stuff was removed from core would help a lot.
Me too, i would like to know why dynamic_form was removed…
@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]
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)
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 %>
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
See also regarding their removal: http://news.ycombinator.com/item?id=1263775
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.
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?
@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:
Rails sucks, Ramaze is the way.
Regarding the rails/cli error, try script/rails instead of rails command.
<%= f.error_messages %> does not work either
@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.
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?
Experiencing the same problem as bhavinkamani. The plugin is installed and there are still plugin installation notices and no error_messages_for work.
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”
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
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?
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
Cool! It’s too close to stable release!
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 :)
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.
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.
How about PostgreSQL support?
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/6b3798ea1d92f8d3
Thank you Pawel and sean lynch, the lib dir did the trick! :)
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
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