Amber: Cant build amber app

Created on 10 Jan 2019  路  8Comments  路  Source: amberframework/amber

Description

I can't build a brand new amber app.

Steps to Reproduce

I just followed this guide:
https://docs.amberframework.org/amber/getting-started

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

Amber CLI (amberframework.org) - v0.11.2

Crystal 0.27.0 (2018-11-04)

LLVM: 6.0.1
Default target: x86_64-apple-macosx

Additional Information

09:13:54 Watch run  | (INFO) Building...
Error in src/blogsy.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:1: while requiring "./database.cr"

require "./database.cr"
^

in config/database.cr:5: undefined method 'progname=' for Nil (compile-time type is (Logger | Nil))

Granite.settings.logger.progname = "Granite"
                        ^~~~~~~~

Rerun with --error-trace to show a complete error trace.
09:13:55 Watch run  | (INFO) Compile time errors detected, exiting...
bug

Most helpful comment

I believe this is only an issue until the next release - I hit the same issue recently too. The project you generated it valid apart from a couple of lines, the one listed in the stacktrace you posted and another in spec_helper.

Try replicating the changes made in https://github.com/amberframework/amber/pull/1027 with your generated files and that should get you up and running again.

All 8 comments

I believe this is only an issue until the next release - I hit the same issue recently too. The project you generated it valid apart from a couple of lines, the one listed in the stacktrace you posted and another in spec_helper.

Try replicating the changes made in https://github.com/amberframework/amber/pull/1027 with your generated files and that should get you up and running again.

@elorest Can you do a release of Amber?

Seems to be still present in 0.11.3. I work around it by changing the offending line to Granite.settings.logger.try &.progname = "Granite" Not sure if that's the correct approach, but it makes the build go through.

@Metallord Can you confirm you ran shards update?

Yes. This is right after running shards update:

Using amber (0.11.3)
Using amber_router (0.2.1)
Using cli (0.7.0)
Using optarg (0.5.8)
Using callback (0.6.3)
Using string_inflection (0.2.1)
Using compiled_license (0.1.3)
Using kilt (0.4.0)
Using liquid (0.3.0)
Using inflector (0.1.8)
Using micrate (0.3.3)
Using db (0.5.1)
Using mysql (0.5.1)
Using pg (0.15.0)
Using redis (2.0.0)
Using pool (0.2.3)
Using shell-table (0.9.2 at 078a04ea58ead5203bb435a3b5fff448ddabaeea)
Using slang (1.7.1)
Using sqlite3 (0.10.0)
Using teeplate (0.7.0)
Using exception_page (0.1.1)
Using granite (0.15.2)
Using quartz_mailer (0.5.3)
Using email (0.3.2)
Using jasper_helpers (0.2.4)
Using citrine-i18n (0.3.2)
Using i18n (0.2.0)
Using garnet_spec (0.2.1)
Using selenium (0.4.0)
lord@MacBook Pro ~/code/comms $ amber watch
10:35:21 Watch run  | (INFO) Building...
Error in src/comms.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:1: while requiring "./database.cr"

require "./database.cr"
^

in config/database.cr:5: undefined method 'progname=' for Nil (compile-time type is (Logger | Nil))

Granite.settings.logger.progname = "Granite"
                        ^~~~~~~~

Rerun with --error-trace to show a complete error trace.
10:35:22 Watch run  | (INFO) Compile time errors detected, exiting...

Hi @Metallord Do you still have this issue?

This issue was introduced on v0.11.2. I can't reproduce it on v0.11.3

I guess this was fixed on latest version

BTW, v0.11.3 is now available on AUR, sorry for late update :sweat_smile:

https://aur.archlinux.org/packages/amber/

I just checked and it doesn't happen on a new app. From what I can see the offending line was changed to Granite.settings.logger.not_nil!.progname = "Granite" which is pretty close to my workaround.

I can confirm that this fixes the problem, however if the app was generated on an earlier version of amber then upgrading to 0.11.3 doesn't fix it by itself - you need to manually change that line as well.

I think you should keep this issue opened for a week or two so that it easier to find for people who generated an app on 0.11.2, and after that just close it. I wouldn't expect it to come up further than that.

@faustinoaq Looks like this issue can be closed unless @Iainmon can reproduce this bug on the latest version of Amber.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yorci picture yorci  路  6Comments

Meldanor picture Meldanor  路  4Comments

blankoworld picture blankoworld  路  7Comments

faustinoaq picture faustinoaq  路  6Comments

elorest picture elorest  路  6Comments