DMPbelgium / roadmap

5 stars 1 forks source link

bin/setup doesn't work #49

Closed StCyr closed 2 years ago

StCyr commented 2 years ago

Hi,

I'm trying to setup roadmap on a development server, following the doc https://github.com/DMPRoadmap/roadmap/wiki/Installation

Unfortunatelly, I'm stuck at the bin/setup phase.

For some reasons that I can't figure out myself, rails won't create/setup the database.

Could you help me figure out what's going wrong?

PS: I've already tried to setup the credentials, though it's supposed to happen after the bin/setup step. However, I didn't set the devise_pepper and dragonfly_secret settings yet.

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

master branch

Expected behaviour:

running bin/setup should create the database

Actual behaviour:

== Installing dependencies ==
The Gemfile's dependencies are satisfied

== Copying sample files ==

== Preparing database ==
/usr/local/bin/roadmap/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.7/lib/active_record/associations.rb:1855: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/local/bin/roadmap/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.7/lib/active_record/associations.rb:1368: warning: The called method `has_many' is defined here
FlagShihTzu#has_flags: Table "orgs" doesn't exist.  Have all migrations been run?
FlagShihTzu says: Flag column org_type appears to be missing!
To turn off this warning set check_for_column: false in has_flags definition here: /usr/local/bin/roadmap/app/models/org.rb:169:in `<class:Org>'
FlagShihTzu#has_flags: Table "identifier_schemes" doesn't exist.  Have all migrations been run?
FlagShihTzu says: Flag column context appears to be missing!
To turn off this warning set check_for_column: false in has_flags definition here: /usr/local/bin/roadmap/app/models/identifier_scheme.rb:49:in `<class:IdentifierScheme>'
rails aborted!
NoMethodError: undefined method `for_authentication' for IdentifierScheme(Table doesn't exist):Class
/usr/local/bin/roadmap/vendor/bundle/ruby/2.7.0/gems/activerecord-5.2.7/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
...

Steps to reproduce:

follow steps described in https://github.com/DMPRoadmap/roadmap/wiki/Installation

nicolasfranck commented 2 years ago

Have you tried with the master branch from dmproadmap itself? This is a Belgian fork, with local additions. You could also try:

bin/rails db:schema:load
bin/rails db:migrate

(the "rake" commands for database are moved to the rails command since Rails 4 I guess)

StCyr commented 2 years ago

Hi,

thanks for your answer.

I've already tried bin/rails db:schema:load and bin/rails db:migrate with no luck (same results).

Note that I have to export DB_ADAPTER=mysql2 and export RAILS_ENV=development before running bin/setup or these commands. Maybe my environment is not 100% correct?

I believe I want the Belgian fork.

Could you please re-open the issue? I didn't find any useful resources elsewhere on the Internet to debug this issue.

StCyr commented 2 years ago

hmmm, it seems an issue with my environment eventualy: the last lines of the error logs show:

/usr/local/bin/roadmap/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:schema:dump => db:load_config => environment
(See full trace by running task with --trace)

So, it looks like it's failing in db:load_config or something