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

Cant get basic apps running #867

Closed
AizuddinBadry opened this Issue Jun 16, 2018 · 17 comments

Comments

4 participants
@AizuddinBadry

AizuddinBadry commented Jun 16, 2018

Submitting questions

  • If the question is something like "how do I do X?", consider using StackOverflow
  • If the question is specific to another shard, please post an issue to the shards issue tracking system.

Description

Hello, i've tried to start basic amber apps. However i cant' get it success for some reason. Below is the error i had

03:14:42 Watcher    | (INFO) Watching 10 files (server reload)...
03:14:42 Watcher    | (INFO) Building project Fasttrade...
Error in src/fasttrade.cr:1: while requiring "../config/*"

require "../config/*"
^

in config/application.cr:1: while requiring "./initializers/**"

require "./initializers/**"
^

in config/initializers/database.cr:1: while requiring "granite_orm/adapter/pg"

require "granite_orm/adapter/pg"
^

in lib/granite_orm/src/adapter/pg.cr:1: while requiring "./base"

require "./base"
^

in lib/granite_orm/src/adapter/base.cr:1: while requiring "../granite_orm"

require "../granite_orm"
^

in lib/granite_orm/src/granite_orm.cr:3: while requiring "./granite_orm/base"

require "./granite_orm/base"
^

in lib/granite_orm/src/granite_orm/base.cr:3: while requiring "./fields"

require "./fields"
^

in lib/granite_orm/src/granite_orm/fields.cr:4: undefined constant JSON::Type

  alias Type = JSON::Type | DB::Any

May i know what's the meaning of this error and how i can fix it ?

Steps to Reproduce

  1. amber new fasttrade
  2. shards install
  3. amber w

Expected behavior: [What you expect to happen]
The apps successful running on localhost and i should start see the welcome page

Actual behavior: [What actually happens]
Error in terminal

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

Versions

You can get this information from copy and pasting the output of amber --version and crystal --version from the command line. Also, please include the OS and what version of the OS you're running.

Amber version : Amber CLI (amberframework.org) - v0.7.2
crystal version :
Crystal 0.25.0 (2018-06-15)

LLVM: 5.0.1
Default target: x86_64-apple-macosx

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

@faustinoaq

This comment has been minimized.

Member

faustinoaq commented Jun 16, 2018

Hi @AizuddinBadry this is a duplicate of #847

We're already working on fix this, please see #826

@faustinoaq faustinoaq added this to To Do in Amber Framework 2018 via automation Jun 16, 2018

@faustinoaq

This comment has been minimized.

Member

faustinoaq commented Jun 16, 2018

Please, try using crystal < v0.24.2 😅

@AizuddinBadry

This comment has been minimized.

AizuddinBadry commented Jun 16, 2018

Omg. Sorry for duplication issues. How can i change crystal version ?

@faustinoaq

This comment has been minimized.

Member

faustinoaq commented Jun 16, 2018

@AizuddinBadry don't worry 😅

Try brew install amber@0.7.2

@AizuddinBadry

This comment has been minimized.

AizuddinBadry commented Jun 17, 2018

@faustinoaq i cant install amber@0.7.2.

I got this error from homebrew

Error: No available formula with the name "amber@0.7.2" ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching for similarly named formulae... ==> Searching local taps... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps. Aizuddins-MacBook-Pro:fasttrade aizuddinbadry$ brew update Already up-to-date.

@faustinoaq

This comment has been minimized.

Member

faustinoaq commented Jun 17, 2018

@AizuddinBadry Sorry my bad, I meant brew install crystal-lang@0.24.2 😅

@faustinoaq faustinoaq moved this from To Do to In progress in Amber Framework 2018 Jun 17, 2018

@kliron

This comment has been minimized.

kliron commented Jun 17, 2018

I get

Error: No available formula with the name "crystal-lang@0.24.2" ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching for similarly named formulae... ==> Searching local taps... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps.

@kliron

This comment has been minimized.

kliron commented Jun 17, 2018

Anyway, for anyone having to downgrade (btw Kemal has similar issues with crystal 0.25), just download 0.24.2 from https://github.com/crystal-lang/crystal/releases.

I'm on a mac so I did:

brew uninstall crystal-lang
curl -L -O https://github.com/crystal-lang/crystal/releases/download/0.24.2/crystal-0.24.2-1-darwin-x86_64.tar.gz
tar xvf crystal-0.24.2-1-darwin-x86_64.tar.gz -C ~/opt
ln -s /Users/kliron/opt/crystal-0.24.2-1/bin/crystal /usr/local/bin/crystal

@set

This comment has been minimized.

set commented Jun 18, 2018

@kliron getting "/usr/local/bin/crystal no such file or directory" error after your proccess. please help me :)

@kliron

This comment has been minimized.

kliron commented Jun 18, 2018

@set are you on macOS or linux? The /usr/local/bin is a mac convention, on linux you might need to link somewhere else. You can even just update your $PATH variable to include crystal's /bin directory wherever you have extracted the tarball.

Also, remember, you still need llvm@5 and openssl libraries installed for crystal to work. On macOS do:

brew install llvm@5 openssl

Also, on macOS you need to tell pkgconfig where to find libssl and friends so add this in your ~/.bash_profile:

export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

@set

This comment has been minimized.

set commented Jun 18, 2018

@kliron I'm on macOS, I don't understand why.

@kliron

This comment has been minimized.

kliron commented Jun 18, 2018

The paths I wrote above are just an example. If you don't have an 'opt' directory in your $HOME it won't work. Just extract the crystal-0.24.2-1.tar.gz file somewhere and then link with:

ln -sf /full/path/to/where/you/extracted/crystal-0.24.2-1/bin/crystal /usr/local/bin/crystal

If you do ls -l /usr/local/bin/crystal it should point to the original location. /usr/local/bin/crystal is just a symbolic link.

@set

This comment has been minimized.

set commented Jun 18, 2018

@kliron crystal 0.25 was successfully working on my mac, I want change version from 0.25 to 0.24.2 for amber not working. I make your says, but something is going wrong.

@kliron

This comment has been minimized.

kliron commented Jun 18, 2018

@set Have you uninstalled crystal-lang (the homebrew 0.25 version)?
Could you show me the exact commands you are using?

@kliron

This comment has been minimized.

kliron commented Jun 18, 2018

@set since this is unrelated to this thread, could you just mail me instead? So that we don't spam this thread.

@set

This comment has been minimized.

set commented Jun 18, 2018

@kliron I send mail in your profile address.

@faustinoaq faustinoaq moved this from In progress to Done in Amber Framework 2018 Jun 22, 2018

@faustinoaq

This comment has been minimized.

Member

faustinoaq commented Jun 22, 2018

Fixed by #857

@faustinoaq faustinoaq closed this Jun 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment