The purpose of this article is to introduce the procedure for rails new Rails 6.0.3.1 app in the local environment Rails 6.0.3.3 and the error handling that occurred at that time.
Rails 6.0.3.3
% rails -v
Rails 6.0.3.3
% gem list rails
** LOCAL GEMS ***
rails (6.0.3.4, 6.0.3.3, 6.0.3.2, 5.2.4.3)
gem i -v 6.0.3.1 rails
% gem list rails
*** LOCAL GEMS ***
rails (6.0.3.4, 6.0.3.3, 6.0.3.2, 6.0.3.1, 5.2.4.3)
rails _6.0.3.1_ new SampleApp -d mysql --skip-bundle
---d mysql
specifies DB as mysql.
--Enter the version name (number) you want to specify in place of _6.0.3.1_
.
--new Sample App
is the app name.
---- skip-bundle
specifies that Gemfile should not be read.
At the moment, the local rails version (6.0.3.3 in this case) is specified, so edit the Gemfile and change it to the version you want to specify (6.0.3.1 in this case).
Before change) gem'rails', '~> 6.0.3.3'
After change) gem'rails', '= 6.0.3.1'
--~> 6.0.3.3
means that rails 6.0.x.x (6.0 series) can be used, so the latest 6.0.3.3.
will be installed in this state.
bundle install
% bundle install
Then the following error occurs
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 6.0.3.4)
In Gemfile:
web-console (>= 3.3.0) was resolved to 4.0.4, which depends on
actionview (>= 6.0.0) was resolved to 6.0.3.4, which depends on
activesupport (= 6.0.3.4)
rails (= 6.0.3.1) was resolved to 6.0.3.1, which depends on
activesupport (= 6.0.3.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Simply put, I get an error saying "If you want to specify rails 6.0.3.1
, you can't use other gems unless you match the version! ".
So, as instructed by the error statement, change the version of other gems with bundle update
.
bundle update
% bundle update
% rails -v
Rails 6.0.3.1
[Rails error] What to do if a higher version is included even if you specify the version with rails new https://techtechmedia.com/rails-new-version-error/
Recommended Posts