by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:16
    drujensen commented #1201
  • 14:58
    drujensen commented #1201
  • 14:30
    drujensen synchronize #1201
  • 14:30

    drujensen on replace-logger-with-log

    fix specs (compare)

  • 14:05
    watzon commented #404
  • 13:34
    eliasjpr commented #1201
  • 12:42
    Blacksmoke16 commented #404
  • 12:41
    Blacksmoke16 labeled #404
  • 12:41
    Blacksmoke16 labeled #404
  • 09:36
    damianham synchronize #29
  • 06:03
    watzon opened #404
  • May 27 23:26
    drujensen synchronize #1201
  • May 27 23:26

    drujensen on replace-logger-with-log

    fix missing bundle (compare)

  • May 27 23:19
    drujensen synchronize #1201
  • May 27 23:19

    drujensen on replace-logger-with-log

    remove severity map (compare)

  • May 27 21:32

    drujensen on v0.21.0

    (compare)

  • May 27 21:32

    drujensen on master

    release latest changes (compare)

  • May 27 21:30

    drujensen on master

    Support custom queries in build… (compare)

  • May 27 21:30
    drujensen closed #403
  • May 27 21:28

    drujensen on v0.7.0

    (compare)

Dru Jensen
@drujensen
i think if you create a /config/envrionments/production.yml and delete the/config/environments/.production.encand.encryption_key` file, it will create a new one for you
you will want to copy development.yml to production.yml and update accordingly
Uzay-G
@Uzay-G
it doesn't generate a new one
Dru Jensen
@drujensen
hhmm
Uzay-G
@Uzay-G
how would that work though? it would have to listen to when I create/delete the files
Dru Jensen
@drujensen
@Uzay-G first generate a secure random number. you can do this using amber x “UUID.random"
create a .encryption_key and place the secure random uuid in that file
cp config/environments/development.yml config/environments/production.yml
then run amber encrypt twice
the first time will convert the production.yml to .production.enc
the second time unencrypt and will open the file for you to edit
Uzay-G
@Uzay-G
do u know if the amber heroku buildpack generates the config for you?
i don't want to mess up the config
Dru Jensen
@drujensen
i’m kinda confused
Uzay-G
@Uzay-G
basically i have never edited my production config and i think the buildpack has handled it for me
Dru Jensen
@drujensen
if you don’t have the encryption key, then you can’t open the .production.enc
Uzay-G
@Uzay-G
yeah i know
Dru Jensen
@drujensen
sooo…do you have it or not?
Uzay-G
@Uzay-G
no
Dru Jensen
@drujensen
then i don’t know how the build pack would be able to open it
it would need the key
Uzay-G
@Uzay-G
no i think the buildpack just took care of generating its own config
i have never set any of the config for production
Dru Jensen
@drujensen
Did you set an environment variable?
AMBER_ENCRYPTION_KEY
Uzay-G
@Uzay-G
nope
Dru Jensen
@drujensen
it is either that or the .encryption_key file
hhmm, so not sure how it would be able to open that file
I’m not familiar with the build pack
Uzay-G
@Uzay-G
i think it doesnt open the file. It connects to heroku to set the db url, etc... and then generates the config file. I mean im not sure how it works either
Sam Johnson
@sam0x17
you may not have realized it was using it -- it gets created in the root of the project upon project creation and the buildpacks for heroku will copy it over
and it isn't tracked in the repoi
so if you rm your repo it's lost
7sidedmarble
@7sidedmarble_twitter
Hey, I'm trying to make a new app with Amber .34, Postgres, and crystal .34 and it totally borks as soon as I run a migration
5 replies
I'm having tons of problems lol.
I prefer to use docker-compose, but If I run it in docker-compose using the settings that come from running amber new, npm ends up throwing an error and webpack never compiles my assets
if I run it locally instead, npm and webpack is fine so that good
but no matter what I do, docker or locally, as soon as I run a scaffold command, any subsequent calls to amber w aren't able to get a DB connection
it just throws this:
Unhandled exception: (no message) (DB::ConnectionRefused)
  from lib/pg/src/pg/connection.cr:16:9 in 'initialize'ract normalize-path@2.1.1
  from lib/pg/src/pg/connection.cr:7:5 in 'new'
  from lib/pg/src/pg/driver.cr:3:5 in 'build_connection'
  from lib/db/src/db/database.cr:57:9 in '->'
  from lib/db/src/db/pool.cr:255:3 in 'build_resource'
  from lib/db/src/db/pool.cr:45:34 in 'initialize'
  from lib/db/src/db/pool.cr:38:5 in 'new:initial_pool_size:max_pool_size:max_idle_pool_size:checkout_timeout:retry_attempts:retry_delay'
  from lib/db/src/db/database.cr:56:15 in 'initialize'
  from lib/db/src/db/database.cr:49:5 in 'new'
  from lib/db/src/db.cr:152:5 in 'build_database'
  from lib/db/src/db.cr:148:5 in 'build_database'
  from lib/micrate/src/micrate/cli.cr:121:5 in 'run_up'
  from spec/spec_helper.cr:12:1 in '__crystal_main'
  from /usr/lib/crystal/crystal/main.cr:105:5 in 'main_user_code'
  from /usr/lib/crystal/crystal/main.cr:91:7 in 'main'
  from /usr/lib/crystal/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???
Gagan Shrestha
@ckgagan
Hi
Excited to join this community.

Anyone familiar with this warning

In /usr/local/Cellar/crystal/0.34.0/src/logger.cr:124:3

124 | def initialize(@io : IO?, @level = Severity::INFO, @formatter = DEFAULT_FORMATTER, @progname = "")
^---------
Warning: Deprecated Logger#initialize. Use Log module instead

In /usr/local/Cellar/crystal/0.34.0/src/logger.cr:140:3

140 | {% for name in Severity.constants %}
^
Warning: expanding macro

Dru Jensen
@drujensen
Hi @ckgagan. Welcome
The good news is Crystal 0.34.0 introduced a new api for Log that replaced the Logger. The bad news is Amber built our own custom logging that sat on top of the deprecated one. Someone will have to rewrite that.
for now you can either ignore that warning or add a flag at compile time to disable it
Mikhail Krainik
@mikhail-krainik
Hi. Has amber some helpers like assets_urlwith generate correct path to assets
Narayana ॐ
@Narayana108

Greetings :)

Im a linux sys admin that has written many scripts and some backend code, but I want to learn amber. Unfortunately I need a bit of hand holding and cant find any step by step tutorials for amber. Should I rather learn rails ?

Damian Hamill
@damianham
@Narayana108 the online docs have a getting started section https://docs.amberframework.org/amber/getting-started which will help you get a full stack web application running in just a few minutes by leveraging amber’s code generators. It might be worthwhile reading some background information on Model View Controller application frameworks so you understand the basic concepts. Amber is designed to be familiar to people coming from a Rails environment so there are a lot of similarities. If you get stuck with anything then just ask here and we will help you out. Also check out the recipes which go a lot further in the kinds of applications that can be quickly generated (e.g. SPA).
Narayana ॐ
@Narayana108
@damianham Ok thanks brother, im making some progress