Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect rails 2 app

I need to detect rack apps and rails 2 apps by simply inspecting the files in a project.

I've been able to do this for rack apps by checking for the existence of a config.ru file. Is there something similar I could check for in a rails 2 app?

like image 623
opsb Avatar asked May 09 '26 18:05

opsb


2 Answers

From Phusion Passeger documentation: Phusion Passenger checks whether the virtual host is a Rails application by checking whether the following file exists:

dirname(DocumentRoot) + "/config/environment.rb"

This file exists also for rails 3 projects if that is a problem :/.

like image 176
Joni Avatar answered May 11 '26 10:05

Joni


In config/environment.rb you can look for RAILS_GEM_VERSION = '2.x.x'

In Gemfile.lock for rails (2.x.x)

In Gemfile for gem 'rails', '2.x.x'

like image 28
Stefaan Colman Avatar answered May 11 '26 12:05

Stefaan Colman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!