#225 Upgrading to Rails 3 Part 1
In the first part of this series on upgrading a Rails 2 application to Rails 3, we'll start off by setting up Rails 3.0 Release Candidate in a clean environment. The rails_upgrade plugin will then help us determine what needs upgrading.
Can you show the appropriate changes in the application templates too (gems, routes, changed commands)
Great Screencast in a perfect moment
Thx
Thanks for this Cast, that makes my change to rails 3 quite easier!!!
Railscast's recent videos plays problematically on my machine (VLC 1.1.1 on Ubuntu). Could you provide other more open video formats besides Quicktime? Thank you.
I also have video problems on vcl mac os x.
Just a note that you can point to the Rails 3 branch of will_paginate...
gem 'will_paginate', :git => "http://github.com/mislav/will_paginate.git", :branch => "rails3"
BTW, I had no problems on Ubuntu with Totem player. And here on Mac I found Grapher, it also shows video fine.
I had some problems installing ruby with rvm (readline issue), but after tackling that, this episode was realy helpful, thanks!
Also having VLC problems on OS X.
Excellent episode Ryan. Looking forward to next week! Will look to upgrade one of my apps in the weeks to come. Many thanks.
Please either use a different codec or move back to a coded that has been used in previous (pre 190) screencasts. The video has very poor playback on Windows with VLC 1.x
@Alexander, Thank you. Totem indeed works fine on Ubuntu.
A quick note about encoding for french / german / russian / japanses, etc... developpers.
By default, ruby 1.9 assumes that all your source files are encoded in ASCII(even if they are in UTF-8) so when you write this in a controller :
flash.now[:info] = "succès"
you get this error message : invalid multibyte char (US-ASCII)
To fix this you have to tell ruby 1.9 that the encoding is UTF-8 by using a magic comment at the first line of your ruby source files.
I have written a little tool to add magic comments on top of all your ".rb" files easily
gem install magic_encoding
then call "magic_encoding" in the console from your app's directory.
Cheers
You can specify the encoding used as a parameter like so : "magic_encoding Shift-JIS" (for japanese)
Another note about encoding problems related to MYSQL, the current version of the mysql gem driver (2.8.1) sets the encoding of the attributes of your records by default (even if they are in UTF-8)
you can try the mysql2 gem at http://github.com/brianmario/mysql2
or use the fix suggested here :
http://snaprails.tumblr.com/post/556378216/porting-an-application-to-ruby-1-9
I recommend everyone not to overlook this one as it may crash your app when users try to submit non-ascii characters in a form.
Thanks Ryan for this geat episode - again :-)
Also thanks @m-ryan for pointing out the 1.9 encoding handling!
If you are using the ruby-debug gem, one of it's dependencies is linecache, a different version of which is required for use with with ruby 1.9.x
using this line in your gem file:
http://gist.github.com/507624
will give you flexibility when you run bundle install, as I found here:
http://isitruby19.com/linecache
Also, this worked for me for 1.9.1, but i still get linecache fail for 1.9.2
wow,maybe i should update my rails now
Clear as mud.
@songrit, @Jeremy, @Dominik and other VLC users: you can use the alternate download link for iPod/AppleTV that uses a format VLC seems to render better than the one from the main download link.
@Ryan: maybe can you drop a line to the VLC developers telling them the parameters/codec version you use to encode your latest videos (and the former, if you remember :-) so they can improve their decoder?
Hello its me again
I wanted to tell everyone what went on and how I believe the issue was fixed.
There must have been a dependency I missed and I went back to the video and paused it on the part where you installed the list of packages which I though were more or less optional because I didn't see any thing on the RVM install instructions requiring Rake,Thor,tzinfo,erubies,builder etc. So if anyone else has this problem this is why, pay close attention to all the packages installed in the video. There may be less needed but I felt it was safe to follow word for word to make sure if I had an issue elsewhere.
Thanks anyway
Why isn't there one for today? It's Monday!!
-Railscasts has failed me.
@John Doe: yep, I think we should burn Ryan at the stake so the next guy learns the lesson.
Seriously...
It is unusual though. Does anyone here know Ryan personally? Is everything OK with him, his family etc?
no need to worry, he told via twitter, that "this week's episode will be a bit late". We can "expect it on monday afternoon PST".
http://twitter.com/rbates
I'm so excited about this episode ;)
@Gabe S —You might have something else depending on the old linecache. As soon as I replaced ruby-debug with ruby-debug19 Ruby 1.9.2 worked for me.
This episode cannot be played on my iPhone 4. Any one has similar experience?
Thanks, Ryan! I posted my experience using your guide to port a Rails 2.3.8 application to Rails 3.0.0 with Ruby 1.8.7 here:
http://www.mightyjupiter.com/2010/09/upgrading-to-rails-3.html
Well, when i was trying to fresh install ruby 1.8.7 using rvm, it keeps showing me the error
"/.rvm/log/ruby-1.8.7-p302/configure.error.log" and ended saying there has been an error while running configure.
Can anyone help me on that pls.
thanks.
@yonas: I used MacPorts to install Ruby 1.8.7. That might be easier than messing with RVM.
@yonas Could you give us a little bit more info about your operating system, verion etc? Win/Mac/Linux?
Hi @all.
I'm working with Windows 7 and after trying rake rails:upgrade:check I get the message “rake aborted! fork() function is unimplemented on this machine”. Does it mean that I cannot use this plugin on Windows?
Thanks for a short response.
Marc
Hi ,
I have migrated application rails 2.3.8 to rails 3.0.1 , in this while using paginate_all_by_receiver_deleted showing undefined method `paginate_all_by_receiver_deleted' for #<Class:0xb5ddb750>
any one faced this issue kind give comments
Signing through GitHub?! Cool! ;-) Hope it blocks spammers.
I think it makes no real sense to says "yes" for application_controller and application_helper since they are empty from "rails new" and have the same "declaration" as in rails 2.3 so it's easier to say "no" there.
Its worth mentioning that you need to remove 'config/initializers/new_rails_defaults.rb' If you have one (as mentioned in the file's comments).
Otherwise you get an error like
undefined method 'generate_best_match=' for ActionDispatch::Routing:Module (NoMethodError)
Great Post!
When I run rake rails:upgrade:check
I get
rake aborted!
no such file to load -- test/unit/error
How can I fix it?
Hello every body,
this command line doesn't run any more
i have this error
Invalid application name rails, constant Rails is already in use. Please choose another application name.
what is the solution ?
Tx a lot
G
Thank's for the video
Best regards