That feeling you get when that right tool did all the work
The Amber CLI offers you a set of command line tools to create, generate, scaffold and run your projects quickly and simply.
Ensure you have the necessary dependencies:
- Git: Use your platform specific package manager to install
- NodeJS and Webpack:
postgresis 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 mysqlwhen creating a new application.
Once you have these dependencies, You can build the
ambertool from source:
Download and install
curl -L https://github.com/amberframework/amber/archive/stable.tar.gz | tar xz
sudo make install
If you run into an issue on compilation regarding
Unhandled exception in spawn: fork: Cannot allocate memoryit 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
- 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
sudo yum groupinstall development tools
sudo yum install readline-devel sqlite-devel openssl-devel libyaml-devel gc-devel libevent-devel
You should now be able to run
amberin the command line.
Installing Amber with these package managers also installs Crystal.
- Homebrewbrew tap amberframework/amberbrew install amber
- MacPortssudo port selfupdatesudo port install amber
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"