Amber Framework
WebsiteBlogGithubDiscord
  • Introduction
  • Getting Started
  • Guides
    • Overview
    • Installation
    • Create New App
    • Directory Structure
    • Configuration
    • Docker
    • Controllers
      • Sessions
      • Request & Response Objects
      • Halt!
      • Respond With
      • Params
      • Cookies
      • Filters
      • Flash
      • Redirection
      • CSRF
    • Views
      • Basic View Helpers
      • Form Builder
    • Models
      • Granite
        • Granite's README
        • Migrations
        • Validations
        • Callbacks
        • Associations
        • Querying
        • Bulk Insertions
      • Jennifer
        • Jennifer Docs
        • Migrations
        • Models
    • Routing
      • Pipelines
      • Routes
    • Websockets
      • Channels
      • Sockets
      • JavaScript Client
    • Mailers
    • Testing
      • System Tests
  • Deployment
    • Manual Deploy
    • Digital Ocean
    • Heroku
    • Dokku
  • CLI
    • New
    • Recipes
    • Plugins
    • Generate
    • Database
    • Watch
    • Routes
    • Exec
    • Encrypt
  • Examples
    • Amber Auth
    • Crystal Debug
    • Minimal Configuration
  • Cookbook
    • From Scratch
    • Hello World
    • CORS
    • File Download
    • File Upload
    • Cookies
    • Authenticate
    • JSON API
    • JSON Mapping
    • WebSocket Chat
  • Troubleshooting
  • In Production
  • Contributing
  • Code of Conduct
  • HAVE A QUESTION?
    • Join the Discord
    • Follow on Twitter
    • Submit an issue
Powered by GitBook
On this page
  • Linux
  • From Source
  • For Debian & Ubuntu
  • For RedHat & CentOS
  • For ArchLinux & derivates
  • macOS
  • From source
  1. Guides

Installation

That feeling you get when that right tool did all the work

PreviousOverviewNextCreate New App

Last updated 1 year ago

The Amber CLI offers you a set of command line tools to create, generate, scaffold and run your projects quickly and simply.

Linux

Ensure you have the necessary dependencies:

  • Git: Use your platform specific package manager to install git

  • Crystal: Follow the instructions to get crystal on this page:

  • NodeJS and Webpack: node is an optional dependency and is used to compile JavaScript and other assets.

  • PostgreSQL: postgres is a relational database server. Amber configures applications to use this database adapter by default, but you can switch to MySQL by passing the flag --database mysql when creating a new application.

Once you have these dependencies, You can build the amber tool from source:

From Source

Download and install amber

NOTE: At the time of this writing, v1.4.1 is the current stable release, but you should use the most recent tag in place of that.

sudo apt-get install libreadline-dev libsqlite3-dev libpq-dev libmysqlclient-dev libssl-dev libyaml-dev libpcre3-dev libevent-dev
git clone https://github.com/amberframework/amber.git
cd amber
git checkout v1.4.1
shards install
make
sudo make install

If you run into an issue on compilation regarding Unhandled exception in spawn: fork: Cannot allocate memory it means you don't have enough memory. This can easily be solved by adding a swapfile.

sudo dd if=/dev/zero of=/swapfile bs=2k count=1024k
sudo mkswap /swapfile
sudo chmod 600 /swapfile
sudo swapon /swapfile

For Debian & Ubuntu

  • Currently, the only method to install on Debian based distros is to compile from source.

  • These are necessary to compile the CLI:

  • sudo apt-get install build-essential libreadline-dev libsqlite3-dev libpq-dev libmysqlclient-dev libssl-dev libyaml-dev

For RedHat & CentOS

  • sudo yum groupinstall development tools

  • sudo yum install readline-devel sqlite-devel openssl-devel libyaml-devel gc-devel libevent-devel

For ArchLinux & derivates

  • yaourt -S amber

You should now be able to run amber in the command line.

macOS

Installing Amber with these package managers also installs Crystal.

  • Homebrew

    brew tap amberframework/amber
    brew install amber
  • MacPorts

    sudo port selfupdate
    sudo port install amber

From source

Known problems while trying to build Amber from source on macOS:

  • If you see linker problems, such as ld: library not found for -lssl (this usually means you need to install the development package for libssl), you may need to set some (or all) of those environment variables:

    export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
    export LDFLAGS="-L/usr/local/opt/openssl/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl/include"

Install the CLI from . Dependencies are automatically installed.

Crystal Installation
AUR package