Where to define Rails app's version number

documentation, ruby, ruby-on-rails, versioning

Solution

I will reply my own question, I was not able to find a better answer.

Since Rails application is basically `MySite::Application` I thought app's version should be accessed by `MySite::Application::VERSION` so create :

config/initializers/version.rb

module MySite
  class Application
    VERSION = "0.0.4"
  end
end

or `config/version.rb` and require this file from `config/application.rb`

Problem

Is there any convention about how/where to specify application's version number? For example, for the ruby gems `lib/mygem/version.rb` is the file generally used for that purpose. My guess would be creating `config/version.rb` file like that: ``` module MySite VERSION = "0.0.4" # or in MySite::Application class # # class Application # VERSION = "0.0.4" # end end ```

Original source

Related problems