To fix this please run $ bundle update -ruby The most common cause of this error is the Gemfile.lock was not updated after you modified your Gemfile. Troubleshooting Your Ruby version is, but your Gemfile specified If you need to configure things such as usernames or passwords for private repos, please see bundler configuration. We recommend limiting use of environment variables in your Gemfile and we do not recommend using conditionals. This is handy if you are running your app through a continuous integration tool and want to ensure it checks your codebase against other versions of Ruby, but restrict it to a certain version when deployed to Heroku. This would let you specify a Ruby version in the CUSTOM_RUBY_VERSION environment variable, or default to 2.5.1 if it’s not set. For a Ruby version change to take effect through this method, you’ll need to deploy the app again since Ruby is vendored into each slug. For example: ruby ENV || '2.5.1'Ĭhanging environment variables does not recompile your app. Specifying a Ruby version via the environmentĪ Gemfile is made of up Ruby code, so you can also specify your Ruby version in the environment. If you ever have doubts about the version that Heroku will use you can find out by running this command locally: $ bundle platform -ruby So if different members on your team are using different Ruby versions, they must be careful not to commit the wrong version to the Gemfile.lock. The locked version of the Ruby version will always “win”. To update this version in the Gemfile.lock, change your local Ruby version and run: $ bundle update -ruby In the above scenario if someone with Ruby 2.3.1 on their system runs bundle install then they will get this in the Gemfile.lock: RUBY VERSION For example neither ~> 2.3 or ~> 2.3.x are valid version specifiers on Heroku.īundler locks your Ruby version you are using locally in the Gemfile.lock. For this to work on Heroku, you must specify the full version with all three digits. This is saying that any version of 2.3.x where x is greater than or equal to 0 are valid. For example if you want to deploy using 2.3.0 but some members of your team want to use 2.3.1 you could allow this by specifying: ruby "~> 2.3.0" Ruby Version SpecifiersĪs of bundler 1.12+ you can use a version specifier in your Ruby version. Please see Ruby Support for a list of available versions. You can specify JRuby by using the following line: ruby "2.2.2", :engine => "jruby", :engine_version => "9.0.0.0" > Installing dependencies using Bundler version 1.7.11įor specifying non MRI Ruby engines, you’ll need to use the :engine and :engine_version options. When you commit and push to Heroku you’ll see that Ruby 2.5.1 is detected: -> Heroku receiving push For an updated list see Supported Ruby Versions. Ruby 2.5.1 might not be the latest Ruby version, and is here for demonstration purposes only. Heroku recommends you run the latest Ruby version your app can handle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |