Need help updating my rails version

I am new to Ruby on Rails. I need to upgrade rails version from 1.2.3 to 2.3.5. I am working in a windows environment with a mysql database. Could you help me with the steps involved in upgrading the rails version.

thank

+3
source share
1 answer

As you said that you want to upgrade the rails version of the current application, you have to follow a few steps:

Before that, just check the following settings:

  • Check your .rb environment settings
  • Transfer the .rhtml files to html.erb
  • Check for any changes to route.rb that might be required, given that ROR 2.3.4 made route determination easier.
  • , SCM : git, svn, () cvs. .

  • form_tag, <%= form_tag :action=> "search" %> becomes <% form_tag :action=>"search" do %>

  • <% = end_form_tag% > <% end% > .

, :

  • $sudo gem install rails

  • : : 1.2.3 RubyGems 1.3.1 ( GemRunner), activeresource, Rails 2.3.4 :

    $cd ~/src $ rails rails23- $ cd rails23- $ rake rails: :

  • $cd ~/src/app_to_upgrade $ git checkout -b rails23 # , git

  • Rails

    $rm -rf / $ mv ~/src/rails23-app/vendor/rails vendor

  • /boot.rb public/javascripts/*. application.rb application_controller.rb

    $rake rails:

  • config/initializers/*. , .

    $cp -r ~/src/rails23-app/config/initializers config

  • , config/environment.rb config/environment/* Rails 2.3. , rails23-app

config.time_zone = 'UTC', datetime UTC

, environment.rb , config/initializers/*.

ActionMailer::Base.server_settings ActionMailer::Base.smtp_settings

  1. // , Rails 2.3. Rails , . will_paginate (http://github.com/mislav/will_paginate/tree/master)

  2. , Rails.

  3. Rails 2.3:

  4. git, .

.

+3

Source: https://habr.com/ru/post/1732338/


All Articles