Amber: Can't build basic Amber app.

Created on 26 Nov 2017  Β·  24Comments  Β·  Source: amberframework/amber

Description

I have simply generated a new amber app and did a shards install, nothing more, but when I want to build it (with amber watch or crystal build) I got the following error(s):

Error in src/password-manager.cr:1: while requiring "../config/*"
require "../config/*"
^
in config/application.cr:2: while requiring "amber"
require "amber"
^
in lib/amber/src/amber.cr:15: while requiring "./amber/server/**": can't specify arguments in both, command and args without including "${@}" into your command
require "./amber/server/**"
^
πŸ€– Compile time errors detected. SentryBot shutting down...

Steps to Reproduce

  1. amber new password-manager -d mysql
  2. cd password-manager
  3. shards install
  4. amber watch

Thanks in advance. 🀞

Most helpful comment

Ok that was because of the location of the project

The Project was in "/Users/samuelnait/Documents/Password Manager/password-manager"
I Moved the project to "/Users/samuelnait/password-manager" and that's working fine now.
(I also tried with different database but that definitely was because of the location)
So for those which may encounter the same Problem, just try to move the project closer from the root of the machine. πŸ‘

Thanks everyone for your help ! πŸ˜„

All 24 comments

Hi @Tisamu What amber version are you using?

Amber CLI (amberframework.org) - v0.3.6

I can't reproduce it, looks like shards install isn't working for you:

➜  ~ crystal --version
Crystal 0.23.1 (2017-09-10) LLVM 5.0.0
➜  ~ shards --version
Shards 0.7.2 (2017-11-23)
➜  ~ amber --version
Amber CLI (amberframework.org) - v0.3.6
➜  ~ amber new password-manager -d mysql
Rendering App password-manager in ./password-manager
new       src/password-manager.cr
new       src/views/layouts/application.slang
new       src/views/layouts/_nav.slang
new       src/views/home/index.slang
new       src/controllers/home_controller.cr
new       src/controllers/error_controller.cr
new       src/controllers/application_controller.cr
new       src/assets/stylesheets/main.scss
new       src/assets/javascripts/main.js
new       src/assets/images/logo.png
new       src/assets/images/.gitkeep
new       src/assets/fonts/.gitkeep
new       spec/spec_helper.cr
new       shard.yml
new       public/robots.txt
new       public/dist/main.bundle.js
new       public/dist/main.bundle.css
new       public/dist/images/logo.png
new       public/crossdomain.xml
new       package.json
new       docker-compose.yml
new       config/webpack/production.js
new       config/webpack/development.js
new       config/webpack/common.js
new       config/routes.cr
new       config/initializers/.git-keep
new       config/environments/test.yml
new       config/environments/production.yml
new       config/environments/development.yml
new       config/deploy/Dockerfile
new       config/database.yml
new       config/application.cr
new       README.md
new       Dockerfile
new       .travis.yml
new       .gitignore
new       .amber_secret_key
new       .amber.yml
➜  ~ cd password-manager 
➜  password-manager shards install
Fetching https://github.com/amberframework/amber.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/jeromegn/kilt.git
Fetching https://github.com/jeromegn/slang.git
Fetching https://github.com/stefanwille/crystal-redis.git
Fetching https://github.com/mosop/cli.git
Fetching https://github.com/mosop/optarg.git
Fetching https://github.com/mosop/callback.git
Fetching https://github.com/mosop/string_inflection.git
Fetching https://github.com/mosop/teeplate.git
Fetching https://github.com/samueleaton/sentry.git
Fetching https://github.com/juanedi/micrate.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/jwaldrip/shell-table.cr.git
Fetching https://github.com/askn/spinner.git
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-mysql.git
Fetching https://github.com/crystal-lang/crystal-sqlite3.git
Fetching https://github.com/amberframework/granite-orm.git
Fetching https://github.com/amberframework/quartz-mailer.git
Fetching https://github.com/raydf/smtp.cr.git
Fetching https://github.com/amberframework/jasper-helpers.git
Fetching https://github.com/amberframework/garnet-spec.git
Fetching https://github.com/ysbaddaden/selenium-webdriver-crystal.git
Installing amber (0.3.6)
Installing radix (0.3.8)
Installing kilt (0.4.0)
Installing slang (1.7.0)
Installing redis (1.9.0)
Installing cli (0.6.10)
Installing optarg (0.5.8)
Installing callback (0.6.3)
Installing string_inflection (0.2.1)
Installing teeplate (0.4.5)
Installing sentry (0.1.1)
Installing micrate (0.3.0)
Installing db (0.4.3)
Installing shell-table (0.9.2)
Installing spinner (0.1.1)
Installing pg (0.13.4)
Installing mysql (0.3.3)
Installing sqlite3 (0.8.3)
Installing granite_orm (0.7.8)
Installing quartz_mailer (0.2.0 at 0.2.1)
Installing smtp (0.1.0 at 0.1)
Installing jasper_helpers (0.1.6)
Installing garnet_spec (0.1.1)
Installing selenium (0.3.0)
➜  password-manager amber watch                                                                         
πŸ€–  Your SentryBot is vigilant. beep-boop...
πŸ€–  watching file: ./src/password-manager.cr
πŸ€–  watching file: ./src/controllers/error_controller.cr
πŸ€–  watching file: ./src/controllers/home_controller.cr
πŸ€–  watching file: ./src/controllers/application_controller.cr
πŸ€–  watching file: ./config/routes.cr
πŸ€–  watching file: ./config/application.cr
πŸ€–  watching file: ./src/views/layouts/application.slang
πŸ€–  watching file: ./src/views/layouts/_nav.slang
πŸ€–  watching file: ./src/views/home/index.slang
πŸ€–  compiling password-manager...
πŸ€–  starting password-manager...
I, [2017-11-27 03:37:29 -0500 #22651]  INFO -- : [Amber 0.3.6] serving application "password-manager" at http://0.0.0.0:3000
I, [2017-11-27 03:37:29 -0500 #22651]  INFO -- : Server started in development.
I, [2017-11-27 03:37:29 -0500 #22651]  INFO -- : Startup Time 00:00:00.0002200

Please check it again and see if you have something different to my logs.

Yes, the version of LLVM & Shards aren't the same, could this be the problem ?
Crystal 0.23.1 (2017-10-12) LLVM 4.0.1
Shards 0.7.1 (2017-10-12)

@Tisamu I cannot duplicate this issue as well. What OS are you using? How did you install amber? What amber version are you using?

I'm on MacOS High Sierra 10.13.1

I installed it with brew and my version of amber is v0.3.6

try bypassing sentry and let me know if you still can't compile and run:

crystal run src/password-manager.cr

The problem doesn't seem to be Sentry.

$ crystal run src/password-manager.cr
Error in src/password-manager.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:2: while requiring "amber"

require "amber"
^

in lib/amber/src/amber.cr:15: while requiring "./amber/server/**": can't specify arguments in both, command and args without including "${@}" into your command

require "./amber/server/**"
^

I am also running on High Sierra and Can't Replicate.

If you have a second I could jump on screen share with you and try to solve this issue.

strange, I have the same crystal, shards, os versions. I re-installed via brew and I still can't duplicate this error. what do you get when you run?:

crystal build --error-trace src/password-manager.cr

Nothing more than

$ crystal build --error-trace src/password-manager.cr
Error in src/password-manager.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:2: while requiring "amber"

require "amber"
^

in lib/amber/src/amber.cr:15: while requiring "./amber/server/**": can't specify arguments in both, command and args without including "${@}" into your command

require "./amber/server/**"
^

That's strange indeed, I tried to reinstall everything to get the cleanest environnement possible but I'm still getting this error.

I'm working on a Kemal project in parallel which is working like a charm (I began the Kemal project after trying to make amber works btw), so I don't understand the source of this error. πŸ€”

If you have time to screen share tomorrow I'll try to solve it for you.

On Nov 28, 2017 1:04 AM, "Samuel NAIT" notifications@github.com wrote:

Nothing more than

$ crystal build --error-trace src/password-manager.cr
Error in src/password-manager.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:2: while requiring "amber"

require "amber"
^

in lib/amber/src/amber.cr:15: while requiring "./amber/server/**": can't specify arguments in both, command and args without including "${@}" into your command

require "./amber/server/**"
^

That's strange indeed, I tried to reinstall everything to get the cleanest
environnement possible but I'm still getting this error.

I'm working on a Kemal project in parallel which is working like a charm
(I began the Kemal project after trying to make amber works btw), so I
don't understand the source of this error. πŸ€”

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/amberframework/amber/issues/418#issuecomment-347443831,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHmpAIcDJPYbEa4MCu-2vjf-K4rD5Mmks5s676CgaJpZM4Qq6zv
.

Unfortunately I won't have any time for Screensharing but thanks anyway.

What intrigues me is that's doesn't look like an Amber specific error but more like a crystal file requierement error, which doesn't happen anywhere else on my crystal projects.

I put my versions again here to clarify what is my environnement:
Using The latest MacBook Pro TouchBar, this exact model:
https://www.apple.com/fr/shop/buy-mac/macbook-pro?product=MPTR2FN/A&step=config#
capture d ecran 2017-11-28 a 09 23 24

$ crystal -v
Crystal 0.23.1 (2017-10-12) LLVM 4.0.1
$ shards --version
Shards 0.7.1 (2017-10-12)
$ amber -v
Amber CLI (amberframework.org) - v0.3.6

🀞

@Tisamu very strange indeed. I really hope we can track this down. You might not be the only one encountering this.

How did you install crystal?

Can you try a different database?

amber new blog -d postgres --deps
cd blog && amber w

@Tisamu I just tried replicating this with the exact same project name and everything on 3 different macs and ubuntu.

I'm wondering if there's something strange set in an ENV var or something...

Could you maybe try it from a different user or a different base folder at least?

Thanks for reporting this but I can't think of anything else.

Ok that was because of the location of the project

The Project was in "/Users/samuelnait/Documents/Password Manager/password-manager"
I Moved the project to "/Users/samuelnait/password-manager" and that's working fine now.
(I also tried with different database but that definitely was because of the location)
So for those which may encounter the same Problem, just try to move the project closer from the root of the machine. πŸ‘

Thanks everyone for your help ! πŸ˜„

Looks like it’s the space in the path. Thanks for reporting this.

Thanks for solving that. Topically with Unix (or any OS IMO) spaces in file
names are evil. 😈

On Nov 28, 2017 9:23 PM, "Dru Jensen" notifications@github.com wrote:

Looks like it’s the space in the path. Thanks for reporting this.

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/amberframework/amber/issues/418#issuecomment-347748936,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHmpMleo1s5RiK6kO1amgGSZ-y8FXQZks5s7NxAgaJpZM4Qq6zv
.

Error message is here πŸ‘‰ https://github.com/crystal-lang/crystal/blob/1978c8b9a9e01dc97703eb99dbaf1057ac70537f/src/process.cr#L321

Seems to be Process.run unable to find project path

Yeah. Because of the space it thinks everything after it is an argument.

On Nov 28, 2017 11:24 PM, "Faustino Aguilar" notifications@github.com
wrote:

Error message is here πŸ‘‰ https://github.com/crystal-lang/crystal/blob/
1978c8b9a9e01dc97703eb99dbaf1057ac70537f/src/process.cr#L321

Seems to be Process.run unable to find project path

β€”
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/amberframework/amber/issues/418#issuecomment-347765310,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHmpKmUGO4osgQlyC-wQKyP3wgYYj4zks5s7Pi5gaJpZM4Qq6zv
.

Ok Nice so the problem was a space in the Path to project folder,

So I guess it's closed πŸ‘

Yeah. Because of the space it thinks everything after it is an argument.

@elorest Maybe we can handle path with white spaces too, using something like surrounding path with double quotes

$ crystal build "/Users/samuelnait/Documents/Password Manager/password-manager/src/app.cr"
$ "./Users/samuelnait/Documents/Password Manager/password-manager/bin/app"

Is this possible?

That should work. Also probably relative paths would work.

On Nov 29, 2017 10:39 AM, "Faustino Aguilar" notifications@github.com
wrote:

Yeah. Because of the space it thinks everything after it is an argument.

@elorest https://github.com/elorest Maybe we can handle path with white
spaces too, using something like surrounding path with double quotes

$ crystal build "/Users/samuelnait/Documents/Password Manager/password-manager/src/app.cr"
$ "./Users/samuelnait/Documents/Password Manager/password-manager/bin/app"

Is this possible?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/amberframework/amber/issues/418#issuecomment-347937867,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHmpL0jkMuVVv8m241Zpc_fr0NfSzvvks5s7ZbYgaJpZM4Qq6zv
.

It looks like crystal looks up the route and then calls it again during the compile process. So even if it's right or a relative route to begin with I think the compiler will mess it up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faustinoaq picture faustinoaq  Β·  5Comments

drujensen picture drujensen  Β·  6Comments

conradwt picture conradwt  Β·  3Comments

elorest picture elorest  Β·  6Comments

netwarp picture netwarp  Β·  6Comments