How can I run this application?

Hi all. I am not a ruby developer but I need help understanding how to run this app and would appreciate it. I dont even know if this is ruby on rails or just normal ruby so I am sorry if I posted this in the wrong forum. I have tried contacting the company several times but I end up getting ignored. I have also attempted to get this running by myself for months now but I end up saying “I’ll try again tomorrow” but try it again about once a month.

The app is a analytics server from embarcadero. They used to offer this as a service but has stopped providing this service about 2 years ago. Because of this they released the source code.

Source: AppAnalytics Server

I have tried so many things to get this to run but I am constantly failing and retrying all the time. Every time I have to start from scratch because I keep messing up something.

The project folder looks like the following:

Also See:

test@test:~/AppAnalytics$ tree
.
├── app
│ ├── assets
│ │ ├── images
│ │ │ ├── onboard-background.png
│ │ │ └── rails.png
│ │ ├── javascripts
│ │ │ ├── admin.js.coffee
│ │ │ ├── app.js.coffee
│ │ │ ├── application.js
│ │ │ ├── charges.js.coffee
│ │ │ ├── d3.v3.min.js
│ │ │ ├── hooks.js.coffee
│ │ │ ├── jquery.tablesorter.min.js
│ │ │ ├── sankey.js
│ │ │ └── user.js.coffee
│ │ └── stylesheets
│ │ ├── admin.css.scss
│ │ ├── app.css.scss
│ │ ├── application.css.scss
│ │ ├── charges.css.scss
│ │ ├── hooks.css.scss
│ │ └── user.css.scss
│ ├── controllers
│ │ ├── admin_controller.rb
│ │ ├── app_controller.rb
│ │ ├── application_controller.rb
│ │ ├── charges_controller.rb
│ │ ├── hooks_controller.rb
│ │ ├── user_controller.rb
│ │ └── web_service_controller.rb
│ ├── helpers
│ │ ├── admin_helper.rb
│ │ ├── app_helper.rb
│ │ ├── application_helper.rb
│ │ ├── charges_helper.rb
│ │ ├── hooks_helper.rb
│ │ └── user_helper.rb
│ ├── mailers
│ │ └── user_mailer.rb
│ ├── models
│ │ ├── app.rb
│ │ ├── app_usage_day.rb
│ │ ├── control_focus_event.rb
│ │ ├── crash_event.rb
│ │ ├── end_user.rb
│ │ ├── end_user_session.rb
│ │ ├── event.rb
│ │ ├── form_activate_event.rb
│ │ ├── global_setting.rb
│ │ ├── plan.rb
│ │ ├── report.rb
│ │ ├── role.rb
│ │ ├── track_event.rb
│ │ ├── user_app_access.rb
│ │ └── user.rb
│ └── views
│ ├── admin
│ │ ├── edit_plan.html.erb
│ │ ├── edit_user.html.erb
│ │ ├── index.html.erb
│ │ ├── list.html.erb
│ │ └── _user_info_card.html.erb
│ ├── app
│ │ ├── crashes.html.erb
│ │ ├── crash_flow.html.erb
│ │ ├── _date_range_picker.html.erb
│ │ ├── delete.html.erb
│ │ ├── edit.html.erb
│ │ ├── events.html.erb
│ │ ├── flow.html.erb
│ │ ├── _header.html.erb
│ │ ├── list.html.erb
│ │ ├── new.html.erb
│ │ ├── paused.html.erb
│ │ ├── reports.html.erb
│ │ ├── run_report.html.erb
│ │ ├── run_report.js.erb
│ │ ├── sankey.html.erb
│ │ ├── set_plan.html.erb
│ │ ├── show.html.erb
│ │ ├── slice.html.erb
│ │ ├── slice.text.erb
│ │ └── today.html.erb
│ ├── charges
│ │ ├── charges.html.erb
│ │ ├── create.html.erb
│ │ └── new.html.erb
│ ├── devise
│ │ ├── confirmations
│ │ │ └── new.html.erb
│ │ ├── mailer
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── reset_password_instructions.html.erb
│ │ │ └── unlock_instructions.html.erb
│ │ ├── passwords
│ │ │ ├── edit.html.erb
│ │ │ └── new.html.erb
│ │ ├── registrations
│ │ │ ├── edit.html.erb
│ │ │ └── new.html.erb
│ │ ├── sessions
│ │ │ └── new.html.erb
│ │ ├── shared
│ │ │ └── _links.erb
│ │ └── unlocks
│ │ └── new.html.erb
│ ├── hooks
│ ├── layouts
│ │ └── application.html.erb
│ ├── user
│ │ ├── check_tos.html.erb
│ │ ├── confirm_cancel.html.erb
│ │ └── set_plan.html.erb
│ └── user_mailer
│ ├── invite_email.text.erb
│ ├── invoice_email.text.erb
│ ├── notify_approaching_limit_email.text.erb
│ ├── notify_cancel_email.text.erb
│ ├── notify_new_user_email.text.erb
│ ├── notify_over_limit_email.text.erb
│ ├── report_email.html.erb
│ └── report_email.text.erb
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml.example
│ ├── deploy
│ │ ├── appanalytics_live.rb
│ │ └── appanalytics_staging.rb
│ ├── deploy.rb
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ ├── staging.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── backtrace_silencers.rb
│ │ ├── devise.rb
│ │ ├── env.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ ├── secret_token.rb
│ │ ├── session_store.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ ├── devise.en.yml
│ │ └── en.yml
│ ├── routes.rb
│ └── schedule.rb
├── config.ru
├── db
│ ├── development.sqlite3
│ ├── migrate
│ │ ├── 20131111234937_create_users.rb
│ │ ├── 20131111235454_add_devise_to_users.rb
│ │ ├── 20131111235757_create_apps.rb
│ │ ├── 20131112045210_create_events.rb
│ │ ├── 20131114233202_add_count_to_events.rb
│ │ ├── 20131127080641_add_plan_code_to_app.rb
│ │ ├── 20131127160023_add_stripe_id_to_customer.rb
│ │ ├── 20131205184629_add_event_suborder.rb
│ │ ├── 20140204212043_create_reports.rb
│ │ ├── 20140402223735_create_plans.rb
│ │ ├── 20140515171903_create_user_app_accesses.rb
│ │ ├── 20140701151549_add_active_columns.rb
│ │ ├── 20141124191554_create_end_users.rb
│ │ ├── 20141124191610_create_end_user_sessions.rb
│ │ ├── 20141124191627_create_track_events.rb
│ │ ├── 20141124191858_create_form_activate_events.rb
│ │ ├── 20141124191915_create_control_focus_events.rb
│ │ ├── 20141124191943_create_crash_events.rb
│ │ ├── 20141126163043_create_form_and_control_summaries.rb
│ │ ├── 20141126220909_add_indexes_for_normalized_tables.rb
│ │ ├── 20141129164412_create_track_event_summaries.rb
│ │ ├── 20150310190749_denormalize_all_events.rb
│ │ ├── 20150319192748_add_edn_fields.rb
│ │ ├── 20150401230321_create_app_usage_months.rb
│ │ ├── 20150402002017_create_roles.rb
│ │ ├── 20150402143738_add_admin_user_fields.rb
│ │ ├── 20150403153925_create_global_settings.rb
│ │ ├── 20150404154033_add_dirty_fields.rb
│ │ ├── 20150404213413_add_keen_fields.rb
│ │ ├── 20150417211725_add_app_count_to_plan.rb
│ │ ├── 20150519201418_add_tos_acceptance.rb
│ │ ├── 20150520162451_add_subscription_attributes_to_user.rb
│ │ └── 20150715184345_add_dev_tool_to_app.rb
│ ├── schema.rb
│ ├── seeds.rb
│ └── test.sqlite3
├── doc
├── Gemfile.lock
├── lib
│ ├── assets
│ ├── capistrano
│ │ └── tasks
│ ├── scripts
│ │ ├── convert_db.rb
│ │ └── do_summaries.rb
│ └── tasks
│ └── factory_girl.rake
├── License.txt
├── log
├── public
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ ├── datastore.php
│ ├── d.php
│ ├── dtest.php
│ ├── favicon.ico
│ ├── robots.txt
│ └── terms-of-service
│ └── index.html
├── script
├── spec
│ ├── controllers
│ │ ├── admin_controller_spec.rb
│ │ ├── app_controller_spec.rb
│ │ └── hooks_controller_spec.rb
│ ├── factories
│ │ ├── app_usage_months.rb
│ │ ├── global_settings.rb
│ │ └── roles.rb
│ ├── models
│ │ ├── app_spec.rb
│ │ ├── app_usage_month_spec.rb
│ │ ├── control_focus_event_spec.rb
│ │ ├── crash_event_spec.rb
│ │ ├── end_user_session_spec.rb
│ │ ├── end_user_spec.rb
│ │ ├── form_activate_event_spec.rb
│ │ ├── global_setting_spec.rb
│ │ ├── role_spec.rb
│ │ ├── track_event_spec.rb
│ │ └── user_spec.rb
│ ├── rails_helper.rb
│ └── spec_helper.rb
├── test
│ ├── factories
│ │ ├── plans.rb
│ │ └── user_app_accesses.rb
│ ├── factories.rb_old
│ ├── fixtures
│ │ ├── apps.yml
│ │ ├── events.yml
│ │ ├── reports.yml
│ │ └── users.yml
│ ├── functional
│ │ ├── app_controller_test.rb
│ │ ├── charges_controller_test.rb
│ │ ├── hooks_controller_test.rb
│ │ ├── user_controller_test.rb
│ │ └── user_mailer_test.rb
│ ├── integration
│ ├── performance
│ │ └── browsing_test.rb
│ ├── test_helper.rb
│ └── unit
│ ├── app_test.rb
│ ├── event_test.rb
│ ├── helpers
│ │ ├── app_helper_test.rb
│ │ ├── charges_helper_test.rb
│ │ ├── hooks_helper_test.rb
│ │ └── user_helper_test.rb
│ ├── plan_test.rb
│ ├── report_test.rb
│ ├── user_app_access_test.rb
│ └── user_test.rb
└── Third Party Licenses.txt

55 directories, 216 files

I have gone through many stack overflow questions and answers with no avail.

Things I have noticed I need but I do not have:

  1. GemFile
  2. RakeFile

In order to generate the gemfile I have run the bundle init command. This does work. I am still missing the rakefile however. I am unable to generate one or obtain one. I ended up going through the whole project to better understand it and ended up finding a factory_girl.rake file located in the \lib\tasks folder.

The question is. How can I setup and run this?

Thanks in advance.

You have installed Ruby and Rails? Have you set up a database and migrated? Have you been able to launch a localhost:3000 browser? You really haven’t told us nearly enough to know where you are. It is a RoR app. Once you are able to get it displayed in the browser you’ll be able to identify and fix errors.

Like I said I am stuck on the rake part. I do not have a rake file. I have found a factory_girl.rake. Is the the alt to the rake file? if so how can I use this instead?

This is a Ruby on Rails app. Ruby on Rails is a server side MVC web framework that lets you write webapps.

The tree structure of the files and directories looks nice, but it’s probably an older version of rails. You can take a look at the Gemfile for the info. Run bundle install to install all dependencies. To launch this app, run rails s -b 0 -p 8080, which will run it on 0.0.0.0:8080, and then you can visit localhost:8080 on the device.

The files under db has some rb files that are called database schemas, running rails db:{create,migrate} will create the database and will run a so called migration. So you can then launch the terminal with rails c as well.

So the steps to run this are:

  1. bundle install

  2. rails db:{create,migrate} or rails db:{drop,create,migrate,seed} to drop the database, then create a new db, then migrate the db, and then seed the db with sample data if any (db/seeds.rb need to have appropriate code for that).

  3. rails s or rails s -b IP -p PORT

And you can launch it on your localhost.

1 Like

Thank for this information. I now have a better understanding.

The way I understand this is that the gemfile contains all the required dependencies.

My problem is. I don’t have a gemfile. Only a gemfile.lock. The gemfile.lock does contain everything.

When trying to run bundle install is says there is no Gemfile regardless of the Gemfile.lock exists. When I run the bundle init command it generates a Gemfile with a example inside of it.

How can I run the Gemfile.lock? Do I need go through the Gemfile.lock and manually install all those?

The Gemfile.lock looks as follows:

GIT
remote: github/capistrano/capistrano {I removed the link due to limitations}
revision: 0445e8982159275eef8d393c663aa8326af7642e
specs:
capistrano (3.4.0)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)

GIT
remote: GitHub - stripe/stripe-ruby: Ruby library for the Stripe API. {I removed the link due to limitations}
revision: f369ca16f956979d7e2a68242399417197f43168
specs:
stripe (1.9.9)
mime-types (~> 1.25)
multi_json (>= 1.0.4, < 2)
rest-client (~> 1.4)

GEM
remote: rubygems org/ {I removed the link due to limitations}
specs:
actionmailer (3.2.16)
actionpack (= 3.2.16)
mail (~> 2.5.4)
actionpack (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.16)
activesupport (= 3.2.16)
builder (~> 3.0.0)
activerecord (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
activesupport (3.2.16)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
addressable (2.3.7)
akami (1.2.2)
gyoku (>= 0.4.0)
nokogiri
arel (3.0.3)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
blankslate (3.1.3)
bootstrap-daterangepicker-rails (0.0.8)
railties (>= 3.1)
bootstrap-sass (3.1.1.1)
sass (~> 3.2)
builder (3.0.4)
capistrano-bundler (1.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano-rails (1.1.0)
capistrano (>= 3.0.0)
capistrano-bundler (>= 1.0.0)
capistrano-rvm (0.1.1)
capistrano (~> 3.0)
sshkit (~> 1.2)
chronic (0.10.2)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.3)
colorize (0.7.5)
dante (0.2.0)
devise (3.2.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.0)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
faker (1.2.0)
i18n (~> 0.5)
gyoku (1.2.2)
builder (>= 2.1.2)
hike (1.2.3)
httpi (2.3.0)
rack
i18n (0.7.0)
influxdb (0.1.8)
json
jimson-temp (0.9.5)
blankslate (>= 3.1.2)
multi_json (~> 1.0)
rack (~> 1.4)
rest-client (~> 1.0)
journey (1.0.4)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.1.1)
railties (>= 3.1.0)
jquery_datepicker (0.4)
json (1.8.1)
keen (0.8.8)
addressable (~> 2.3.5)
multi_json (~> 1.3)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.6.2)
momentjs-rails (2.6.0)
railties (>= 3.1)
multi_json (1.11.0)
mysql2 (0.3.18)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
nori (2.4.0)
orm_adapter (0.5.0)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.16)
actionmailer (= 3.2.16)
actionpack (= 3.2.16)
activerecord (= 3.2.16)
activeresource (= 3.2.16)
activesupport (= 3.2.16)
bundler (~> 1.0)
railties (= 3.2.16)
railties (3.2.16)
actionpack (= 3.2.16)
activesupport (= 3.2.16)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.4.2)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec-core (3.0.2)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.2)
rspec-support (~> 3.0.0)
rspec-rails (3.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.2)
sass (3.2.12)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
savon (2.9.0)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.2)
httpi (~> 2.3)
nokogiri (>= 1.4.0)
nori (~> 2.4)
uuid (~> 2.3.7)
wasabi (= 3.3.0)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sshkit (1.7.1)
colorize (>= 0.7.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stripe-ruby-mock (1.8.7.7)
dante (>= 0.2.0)
jimson-temp
stripe (>= 1.8.4)
systemu (2.6.4)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.38)
uglifier (2.3.3)
execjs (>= 0.3.0)
json (>= 1.8.0)
uuid (2.3.7)
macaddr (~> 1.0)
warden (1.2.3)
rack (>= 1.0)
wasabi (3.3.0)
httpi (~> 2.0)
mime-types (< 2.0.0)
nokogiri (>= 1.4.0)
wash_out (0.9.2)
nori (>= 2.0.0)
whenever (0.9.4)
chronic (>= 0.6.3)

PLATFORMS
ruby

DEPENDENCIES
bootstrap-daterangepicker-rails
bootstrap-sass (~> 3.1.1)
capistrano!
capistrano-bundler
capistrano-rails
capistrano-rvm
coffee-rails (~> 3.2.1)
devise
factory_girl_rails
faker
influxdb
jquery-rails
jquery-ui-rails
jquery_datepicker
json
keen
momentjs-rails
mysql2
rails (= 3.2.16)
rspec-rails
sass-rails (~> 3.2.3)
savon (~> 2.0)
stripe!
stripe-ruby-mock
uglifier (>= 1.0.3)
wash_out
whenever

bundle install read Gemfile and modify the Gemfile.lock according to that.

The Gemfile.lock contains all the dependency.

There’s not really a good way to derive Gemfile out of Gemfile.lock. But you can create a Gemfile, and put the codes under GEM section there. A sample Gemfile will look like this:

source 'https://rubygems.org'

gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
gem 'puma', '~> 4.1'
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
gem 'turbolinks', '~> 5'
gem 'bootsnap', '>= 1.4.2', require: false
gem 'linux_stat', "1.2.3"

group :development do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'irb', require: false
gem 'rdoc', require: false

You have to put the versions in ‘~>’ or ‘>=’ or ‘>’, etc. You can also use Ruby to parse the Gemfile.lock file to Gemfile, but that will require you write yet another program that can take more time than the task itself!

1 Like