How can my Rails application accept minor RAILS_GEM_VERSION errors

My rails project has this line in /config/environment.rb

# Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION 

As we now have 2.3.5 as the most recent update, is there a way to make my .rb environment acceptable for minor versions?

(without explicit change 2.3.2 - 2.3.5)

+4
source share
3 answers

No no.

An application needs to use a specific version of Rails mainly because different tiny releases may require additional steps to update the framework, such as changes to boot.rb.

 $ rake rails:update 
+4
source

Things developed a bit with Rails 2, so I shared what I needed to do to get from 5.0.0 to 5.0.0.1 today.

My Gemfile read gem 'rails', '~> 5.0.0' . I figured that was enough , but bundle install did not update anything new. So I tried to do this with gem 'rails', '~> 5.0' , which also didn’t do anything new when I started the update (note: this is for an experimental application and not for another application I'm working on) just by default, version updates to solve such problems;)). So I had to try some more ways to force this patch / security patch.

First I had to install the package locally:

gem install rails --version 5.0.0.1

Then I updated the package:

bundle install

... and I saw this in the output: Using rails 5.0.0.1 (was 5.0.0)


When I ran ./bin/rake rails:update , it destroyed the contents of my config/routes.rb , changed many of my settings in various configuration files (some of which were dangerous security settings to change), among several others, it would seem benign changes. Although this is an expected behavior, I point out that this is not an entirely desirable method for updating a minor fix / fix for rails.

+1
source

First, you need to change the version to 2.3.5 from 2.3.5, and then run

 rake rails:update 
0
source

All Articles