Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out which rails version an existing rails application is built on?

In general, the question I have is the question in the title:

How do I find out which rails version an existing rails application is built on?

More specifically for my purposes, I would like to know how to find out in the case when there is no gemfile (I'm relatively new to rails and used to seeing the rails version in the gemfile with all the rails 3 apps, but am not sure for older versions.)

like image 575
John Avatar asked Oct 19 '12 17:10

John


People also ask

How do I use different rails version?

There's nothing you need to do to manage two different Rails versions. The only thing you'll want to do is gem install rails to get the latest version and create your new project with rails new myapp . That will make sure the new project starts with Rails 5.1 (or whatever is the latest at the time).

How do I install specific version rails?

To install Rails, use the gem install command along with the -v flag to specify the version. For this tutorial, you'll use version 6.1. 4.1 : gem install rails -v 6.1.


2 Answers

Use the command: rake about. This command will output the following info plus more (hence the ellipsis:

About your application's environment Rails version             4.2.0 Ruby version              2.2.2-p95 (x86_64-darwin14)  RubyGems version          2.4.6 ... 
like image 53
conorliv Avatar answered Oct 19 '22 19:10

conorliv


rake gems will print out what gems, dependencies, and versions are installed, frozen, etc.

If you are using bundler than you can use bundle show to list all the gems that your app is using.

like image 21
Raghu Avatar answered Oct 19 '22 17:10

Raghu