Incrementally upgrade rails 4.1 to 4.2

19 views
Skip to first unread message

braini...@gmail.com

unread,
Jan 13, 2019, 4:42:31 PM1/13/19
to Ruby on Rails: Talk
Hi Everyone,

Can you assist me with the syntax to incrementally upgrade rails 4.1 to 4.2?

Thanks,

Hassan Schroeder

unread,
Jan 13, 2019, 6:24:22 PM1/13/19
to rubyonrails-talk
On Sun, Jan 13, 2019 at 1:42 PM <braini...@gmail.com> wrote:

> Can you assist me with the syntax to incrementally upgrade rails 4.1 to 4.2?

I'm not sure what "syntax" is in this context, but upgrading is just a
matter of editing your project Gemfile and running `bundle update`.

And of course fixing deprecation warnings and errors and whatnot 😀

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

braini...@gmail.com

unread,
Jan 13, 2019, 6:29:53 PM1/13/19
to Ruby on Rails: Talk
I do not have an app on the machine yet. I just installed rails 4.1 and I wanted to do an incremental upgrade prior to placing the preexisting app on the machine.

Walter Lee Davis

unread,
Jan 13, 2019, 6:52:03 PM1/13/19
to rubyonra...@googlegroups.com


On Jan 13, 2019, at 4:29 PM, braini...@gmail.com wrote:

I do not have an app on the machine yet. I just installed rails 4.1 and I wanted to do an incremental upgrade prior to placing the preexisting app on the machine.

Any modern Rails app will use bundler, and therefore have a Gemfile that specifies which version of Rails it expects. If you cd into the directory with the application, and type `bundle install`, then the right version of Rails and all dependencies will be installed. 

Then, assuming your tests pass, you can create a new git branch, edit the Gemfile to point to a newer version of Rails, and run `bundle update rails`. That will give you the new Rails and any dependencies that were changed by the update. 

You then have a coin-flip chance that the app will pass its tests, depending on how large a change you made. 

For a start on fixing the differences, you can then run `rake rails:upgrade` or `rails app:upgrade`, depending on which version of Rails you’ve moved to, and that will perform all sorts of automated fixes. It will probably also break some things, too. 

It’s really worthwhile to read the Rails Guide on upgrading. It covers best practices and has lots of helpful hints to debug the changes. 

Walter




On Sunday, January 13, 2019 at 6:24:22 PM UTC-5, Hassan Schroeder wrote:
On Sun, Jan 13, 2019 at 1:42 PM <braini...@gmail.com> wrote:

> Can you assist me with the syntax to incrementally upgrade rails 4.1 to 4.2?

I'm not sure what "syntax" is in this context, but upgrading is just a
matter of editing your project Gemfile and running `bundle update`.

And of course fixing deprecation warnings and errors and whatnot 😀

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e235088-cb19-4d2e-a154-05bbc7e6bdb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

braini...@gmail.com

unread,
Jan 13, 2019, 9:26:54 PM1/13/19
to Ruby on Rails: Talk
Thank you Walter.
Reply all
Reply to author
Forward
0 new messages