Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your install instructions and script are foobar #69

Open
ghost opened this issue Oct 9, 2014 · 2 comments
Open

Your install instructions and script are foobar #69

ghost opened this issue Oct 9, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 9, 2014

The install script doesn't make any sense, even for CentOS.

First, the requirement is for Ruby 1.9.3, but the script tries to install the ruby 1.8-dev package:

E: Unable to locate package ruby1.8-dev
E: Couldn't find any package by regex 'ruby1.8-dev'

Then, it insists on being executed as root, but tries to run the Rails bundle install as root as well. Not fatal during install, but would be once I try to run the rails server as the www-data user:

$ bash install.sh   
Error: Only root can run install.sh
- - - -
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.

The bundler finally ended up failing on a libxml requirement that was not installed by the script, prior to running the bundler.

So, I took over the process myself at that point. After installing libxml2, and ruby-libxml, I tried to run through the basic Rails setup myself, and here's as far as I got:

$ uname -a
Linux dada 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64  x86_64 GNU/Linux

$ lsb_release -a  
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

$ bundle install 
Using rake 10.3.2
Using i18n 0.6.9
Using multi_json 1.10.1
Using activesupport 3.2.18
Using builder 3.0.4
Using activemodel 3.2.18
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.2
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.2.2
Using actionpack 3.2.18
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 3.2.18
Using arel 3.0.3
Using tzinfo 0.3.39
Using activerecord 3.2.18
Using activeresource 3.2.18
Using coffee-script-source 1.7.0
Using execjs 2.2.0
Using coffee-script 2.2.0
Using rack-ssl 1.3.4
Using json 1.8.1
Using rdoc 3.12.2
Using thor 0.19.1
Using railties 3.2.18
Using coffee-rails 3.2.2
Using rest-client 1.6.7
Using docile 1.1.5
Using simplecov-html 0.8.0
Using simplecov 0.8.2
Using tins 1.3.0
Using term-ansicolor 1.3.0
Using coveralls 0.7.0
Using daemon_controller 1.2.0
Using daemons 1.1.9
Using delayed_job 4.0.1
Using delayed_job_active_record 4.0.1
Using diff-lcs 1.2.5
Using faker 1.3.0
Using flexmock 0.9.0
Using hoe 3.12.0
Using jquery-rails 3.1.1
Using libv8 3.16.14.3
Using libxml-ruby 2.7.0
Using machinist 2.0
Using memcache-client 1.8.5
Using mysql2 0.3.16
Using passenger 4.0.45
Using prawn-core 0.5.0.1
Using prawn-format 0.2.0.1
Using prawn-layout 0.2.0.1
Using prawn 0.5.0.1
Using bundler 1.7.3
Using rails 3.2.18
Using rb-readline 0.5.1
Using ref 1.0.5
Using rspec-expectations 2.99.1
Using rspec-collection_matchers 1.0.0
Using rspec-core 2.99.1
Using rspec-mocks 2.99.1
Using rspec-rails 2.99.0
Using ruby-ole 1.2.11.7
Using rubyzip 1.0.0
Using sass 3.3.8
Using sass-rails 3.2.6
Using spreadsheet 0.6.9
Using test-unit 1.2.3
Using therubyracer 0.12.1
Using uglifier 2.5.1
Using zip-zip 0.3
Your bundle is complete!

$ rake db:create
Please provide the root password for your mysql installation
>**********

$ rake db:migrate db:test:prepare  
==  CreateUsers: migrating ====================================================
-- create_table("users", {:force=>true})
-> 0.0563s
==  CreateUsers: migrated (0.0585s) ===========================================

==  CreateProjects: migrating =================================================
-- create_table(:projects)
-> 0.0405s
==  CreateProjects: migrated (0.0421s) ========================================

==  CreateProjectsUsers: migrating ============================================
-- create_table(:projects_users, {:id=>false})
-> 0.0543s
-- add_index(:projects_users, [:user_id, :project_id])
-> 0.1692s
-- add_index(:projects_users, :project_id)
-> 0.0694s
==  CreateProjectsUsers: migrated (0.2947s) ===================================

==  AddUserInformationTables: migrating =======================================
-- add_column(:users, :phone, :string)
-> 0.0317s
-- add_column(:users, :realname, :string)
-> 0.0240s
-- add_column(:users, :description, :text)
-> 0.0215s
==  AddUserInformationTables: migrated (0.0783s) ==============================

==  ConvertToUnicode: migrating ===============================================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Migration error: Unsupported database for migration to UTF-8 support/home/gmgauthier/downloads/tarantula/db/migrate/005_convert_to_unicode.rb:23:in `alter_database_and_tables_charsets'
/home/gmgauthier/downloads/tarantula/db/migrate/005_convert_to_unicode.rb:4:in `up'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:370:in `up'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:410:in `block in migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:389:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:528:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:777:in `call'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:777:in `ddl_transaction'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:719:in `block in migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:700:in `each'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:700:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:570:in `up'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:551:in `migrate'
/var/lib/gems/1.9.1/gems/activerecord-3.2.18/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

$ rake db:seed 
You have 157 pending migrations:
 5 ConvertToUnicode
 6 AddGroupFieldToProjectsUsers
 7 CreateCases
 8 CreateSteps
 9 ConvertTimeEstimateToIntegerInCases
10 CreateTestSets
11 CreateCasesTestSets
12 AddFieldsToTestSets
13 AddOrderColToStep
14 CreateStepExecutions
15 CreateCaseExecutions
16 CreateExecutions
17 CreateExecutionsUsers
18 AddExecutionIds
19 CreateCaseCategories
20 AddResultToExecution
21 AddFieldsToCaseCategories
22 AddCategoryIdToCase
23 AddProjectIdForeignKeyFields
24 AddLatestProjectFieldToUser
25 AddCaseIdToStepExecutions
26 AddCaseExecIdToStepExec
27 AddAdminFieldToUsers
28 AddTimeZoneId
29 RemoveProjectIdFromExecutions
30 ProjectsUsersModification
31 AddCommentFieldToStepExecution
32 AddUpdatedAtFieldToStepexec
33 AddUpdateinfofieldsToExecutions
34 CasesTestSetsJoinModel
35 AddVersionInfo
36 AddDeletedFields
37 VersioninfoToSteps
38 FixVersionFields
39 AddVersionFieldsToExecResults
40 AddDeletedFieldToSteps
41 FixCasesTestSets
42 DeleteDuplicateCaseExecutions
43 AddVersionToExecutions
44 AddVersionToProjectsAndUsers
45 SetVersionDefault
46 AddAssignedToToCaseExecutions
47 CreateTagsAndTaggings
48 AddDefectFieldToStepExecution
49 DropExecutionsUsers
50 RenameOrderColumn
51 DropCreatedFieldsFromStepExecution
52 MoveUpdatedFieldsToCaseExecution
53 RenameUpdatedToExecutedInCaseExecutions
54 AddIndexes
55 ImportCategoriesAsTags
56 DurationToCaseExecutions
57 FixUnversioned
58 CreateCasesSteps
59 AddPositionToCaseExecutions
60 MigrateDataToCasesSteps
61 DropCaseIdAndOrderFromSteps
62 RemoveIdFromCasesTestSets
63 ChangeProjectsUsersToProjectAssignments
20080805095839 AddTestObjectForExecution
20080815062127 CreateAttachments
20080818072906 CreateAttachmentVersioning
20080827105802 AddOriginalIdToCases
20080829092653 AddLibraryAttributeToProjects
20080901065430 CreateTestObjects
20080902075908 TypeNotRunConsistently
20080903112232 AddChangeCommentToCases
20080915055730 AddProjectIdToTestObjects
20080916073323 AddProjectIdToExecution
20080916134313 CreateViewForCaseAvgDuration
20080922072205 AddPriorityToTestSets
20080929060756 AddCompletedToExecutions
20080930095021 ChangeTestSetPriorityToInteger
20081002093136 CreateFlaggings
20081003083855 SetMissingExecutedAtAndExecutedBy
20081006073134 CreateRequirements
20081007053449 AddDeletedToRequirements
20081008125403 AddRequirementAttributes
20081014111201 AddDefaultTagIdToProjectAssignments
20081015104159 DropCaseCategories
20081023105441 AddExternalIdToCasesAndTestSets
20081027083228 AddDefaultTagForcedAttributeToProjectAssignments
20081105073029 AddNewFieldsToRequirement
20081105141939 ScopeTagsToProjectAndTaggableType
20081106103817 CreateBugs
20081114070726 RemoveGuestPermissions
20081121074751 ChangeAllSkippedToNotImplemented
20081126114741 RemoveDefectFieldFromStepExecutions
20081127082336 AddTypeAndDataToAttachments
20081128094745 AddProductIdToBugs
20081201063328 RemoveCategoryIdFromCases
20081201121310 ChageFlaggingsToTasks
20081206134249 CreateTestAreas
20081208115018 CreateBugTrackingBugProducts
20081210063300 AddExternalIdToBugSeverities
20081212115406 ChangeRequirementsDescriptionToText
20090107072557 ChangesToTasks
20090109080421 CreateBugComponents
20090109124642 AddStatusToBugs
20090114122358 ScopeReviewTasks
20090114132104 AddCreatedByToTasks
20090116103740 RenameCommentAsDescriptionInTasks
20090120074105 AddTestObjectToProjectAssignments
20090120084028 MakeAdminItsOwnClass
20090122103708 AddCreatedByToBugs
20090127062321 CreatePreferences
20090216073747 AddReleaseDateToTestObjects
20090218103948 AddMissingFieldsToTestObjects
20090218114452 AddDeletedFieldToTestObjects
20090224081303 AddDateToResources
20090226062206 ForceUpdateAllBugs
20090303130200 TagAllTestObjectsToAllTestAreas
20090312071225 AddPriorityToBugs
20090312124404 AddReportedViaTarantulaFieldToBugs
20090312134201 MarkOldTarantulaReportedBugsAsTarantulaReported
20090313124401 AddSomeMissingIndices
20090318083316 RenameBugTrackersBugPostUrlToBaseUrl
20090318090133 MakeBugTrackerASuperclass
20090320084355 AddMd5PasswordToUsers
20090320092512 ChangeProjectAssignmentsGroupFieldLonger
20090330060935 CreatePasswordResets
20090401124526 CreateTestAreaAssociations
20090403070302 ConvertOldTestAreaTaggingsToTestAreaAssociations
20090406070427 AddPriorityToCases
20090407051906 MakeRequirementsVersioned
20090407090302 CreateBugSnapshots
20090407095136 CreateBugTrackerSnapshots
20090408052120 AddNameToBugTrackerSnapshots
20090507062329 BugProductsTestAreasManyToMany
20090508101617 UpdateTrackersSoTheySweepMovedBugs
20090513080709 AddArchivedBooleanToResources
20090610085152 AddLastdiffedToBugs
20090610113226 AddLastdiffedToBugSnapshots
20090612122200 CreateCustomerConfigs
20090612122201 AddRequiredCustomerConfigs
20090616111335 RenameBugTrackerSnapshots
20090629053240 CreateReportData
20100518085642 AddUrlFieldToBug
20100521092545 AddImportSourceTable
20100521092814 AddImportSourceIdToBugTracker
20100526071235 AddPortToImportSources
20101221081246 AddTitleFieldToCaseExecution
20110114130207 AddSyncFieldToBugTracker
20110117092514 SetSyncFieldToTrueForOldBugzillas
20110117120303 AddIndexesToCasesExecutionsAndTestObjects
20110118102702 AddIndexesToReqsSetsObjects
20110906062657 AddIndexesToBugComponents
20110906062832 AddIndexesToBugProducts
20110906062944 AddIndexesToBugProductsProjects
20110906063241 AddIndexesToBugProductsTestAreas
20110906063407 AddIndexesToBugSeverities
20110906063528 AddIndexesToBugSnapshots
20110906063706 AddIndexesToBugTrackerSnapshots
20110906063756 AddIndexesToBugs
20111129095025 CreateDelayedJobs
20120612070020 AddQueueToDelayedJobs
20120905062740 UpdateMysqlToMysql2InImportSources
Run `rake db:migrate` to update your database then try again.

And that's as far as I've gotten. Here's what my database looks like:

mysql> use testia

Database changed
mysql> show tables
    -> ;
+-------------------+
| Tables_in_testia  |
+-------------------+
| projects          |
| projects_users    |
| schema_migrations |
| users             |
+-------------------+
4 rows in set (0.00 sec)

mysql> show table status;
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| Name              | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| projects          | InnoDB |      10 | Compact    |    0 |              0 |       16384 |               0 |            0 |   9437184 |              1 | 2014-10-09 01:14:18 | NULL        | NULL       | utf8_unicode_ci |     NULL |                |         |
| projects_users    | InnoDB |      10 | Compact    |    0 |              0 |       16384 |               0 |        32768 |   9437184 |           NULL | 2014-10-09 01:14:18 | NULL        | NULL       | utf8_unicode_ci |     NULL |                |         |
| schema_migrations | InnoDB |      10 | Compact    |    4 |           4096 |       16384 |               0 |            0 |   9437184 |           NULL | 2014-10-09 01:14:18 | NULL        | NULL       | utf8_unicode_ci |     NULL |                |         |
| users             | InnoDB |      10 | Compact    |    0 |              0 |       16384 |               0 |            0 |   9437184 |              1 | 2014-10-09 01:14:19 | NULL        | NULL       | utf8_unicode_ci |     NULL |                |         |
+-------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
4 rows in set (0.04 sec)


mysql> show full columns from projects;
+-------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field       | Type         | Collation       | Null | Key | Default | Extra          | Privileges                      | Comment |
+-------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id          | int(11)      | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| name        | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| description | text         | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| visible     | tinyint(1)   | NULL            | YES  |     | NULL    |                | select,insert,update,references |         |
+-------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
4 rows in set (0.00 sec)

mysql> show full columns from projects_users;
+------------+---------+-----------+------+-----+---------+-------+---------------------------------+---------+
| Field      | Type    | Collation | Null | Key | Default | Extra | Privileges                      | Comment |
+------------+---------+-----------+------+-----+---------+-------+---------------------------------+---------+
| project_id | int(11) | NULL      | YES  | MUL | NULL    |       | select,insert,update,references |         |
| user_id    | int(11) | NULL      | YES  | MUL | NULL    |       | select,insert,update,references |         |
+------------+---------+-----------+------+-----+---------+-------+---------------------------------+---------+
2 rows in set (0.00 sec)

mysql> show full columns from schema_migrations;
+---------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| Field   | Type         | Collation       | Null | Key | Default | Extra | Privileges                      | Comment |
+---------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+
| version | varchar(255) | utf8_unicode_ci | NO   | PRI | NULL    |       | select,insert,update,references |         |
+---------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+
1 row in set (0.01 sec)

mysql> show full columns from users;
+---------------------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field                     | Type         | Collation       | Null | Key | Default | Extra          | Privileges                      | Comment |
+---------------------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id                        | int(11)      | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| login                     | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| email                     | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| crypted_password          | varchar(40)  | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| salt                      | varchar(40)  | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| created_at                | datetime     | NULL            | YES  |     | NULL    |                | select,insert,update,references |         |
| updated_at                | datetime     | NULL            | YES  |     | NULL    |                | select,insert,update,references |         |
| remember_token            | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| remember_token_expires_at | datetime     | NULL            | YES  |     | NULL    |                | select,insert,update,references |         |
| phone                     | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| realname                  | varchar(255) | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| description               | text         | utf8_unicode_ci | YES  |     | NULL    |                | select,insert,update,references |         |
+---------------------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
12 rows in set (0.01 sec)

mysql>

Hope this helps,
Greg.

@kirantpatil
Copy link

have a look at https://github.com/msjit/testcasedb

@adam-phillipps
Copy link

adam-phillipps commented May 28, 2017

I am having a similar experience installing and running Tarantula and using a different solution isn't ideal but I might have to resort to it.
I'm trying to automate the setup using Chef and even plain ol' Vagrant with manual steps and am having to make a ton of extra changes to the install script. I noticed in .travis.yml you have a mention of rvm using even more Rubies

...
rvm:
  - "1.9.3"
  - "2.1.1" # I've tried this one to and it just fails on another gem
...

The approach I've taken is to modify the install script by doing the following things:

  • install rbenv and Ruby 1.9.3-p551. I've tried about 10 different versions between 1.8.7 and 2.2.4.
  • create a user called apache in the root group because that's what the default user gets named in the script. I'm betting there will be similarly broken steps later on in the setup so I'm trying to accommodate their defaults, as best I can. I can always change that user or delete it after the install.
  • deleting this root user validation near the top of the install.sh script
if [ $(id -u) -gt 0 ]; then
    echo -e "$(bold_red Error:) Only root can run $0"
    echo -e "Use "$(bold_text "su -c $0")" or "$(bold_text "sudo $0")
    exit 1
fi
  • add sudo to everything EXCEPT bundler commands. So things like yum and apt-get get turned into sudo yum ..... and sudo apt-get ...... Bundle commands have no sudo usage anywhere 'cause that will break :all_the_things:.
bundle <anything> # never has sudo in any script, including the install.sh
  • chown the directories referenced in the script, like /opt/tarantula/* for the apache user
  • run the script as the apache user, which has sudo capabilities.
    Doing that seems to go OK until it gets up to trying to install gems, in the install.sh script.
set -e
cd /opt/tarantula/rails
bundle install --deployment
set +e

Different versions of Ruby break on different dependencies (native extensions usually) but I haven't had any meaningful progress resolving which Ruby to use. I'm assuming there is a version that does work because it was probably run once or twice before pushing it and it wouldn't be hard to miss this kind of issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants