36
loading...
This website collects cookies to deliver better user experience
rbenv local 2.6.5
or rbenv global 2.6.5
and start with rails _6.0.1_ new demo
. I do this but then running bin/rails about
tells me that I've got Rails 6.0.4. with Ruby 2.7.4 instead!rbenv local 2.6.5
then rails _6.0.1_ new demo
and the Gemfile showedRails version 6.0.4.1
Ruby version ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-gnu]
┌─[wasim@parrot]─[~/dev/new/demo]
└──╼ $rbenv local
2.6.5
┌─[wasim@parrot]─[~/dev/new/demo]
└──╼ $cat Gemfile
source 'https://rubygems.org'
gem 'rails', '6.0.1'
┌─[wasim@parrot]─[~/dev/new/demo]
└──╼ $bundle exec rails -v
Rails 6.0.1
bundle install
and then bundle exec rails new . --force --skip-bundle
, I get this:┌─[wasim@parrot]─[~/dev/new/demo]
└──╼ $bundle exec rails -v
Rails 6.0.1
┌─[wasim@parrot]─[~/dev/new/demo]
└──╼ $cat Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.1'
~>
from the version number and running bundle install
, which outputs Using rails 6.0.1
, so it seems like it should work. Running bin/rails about does indeed tell me that we are finally on rails 6.0.1, but Ruby is on version 2.7.4 now! bundle update
, an error message tells me that my versions conflict and it won't proceed. bin/rails server
and everything works. Maybe this will be helpful to someone else starting out with Ruby on Rails.