Setting up an Ember project using Yeoman in Ubuntu 14.04

1. We need C++ compiler.

sudo apt-get install build-essential libssl-dev

2. Install git, bower needs this for fetching dependencies.

sudo apt-get install git

3. Install NVM. Find latest version of NVM from https://github.com/creationix/nvm.

curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash

4. Install node through NVM. Do not install node through apt-get nodejs as this will result in npm install commands always requiring root user access and causing “EACCESS” errors. Latest version of node at this time was 0.10.30. After installation close and re-open terminal.

nvm install 0.10.30

5. Install compass, this is also required by the grunt command. This requires ruby to be present.

sudo gem install compass

6. Install libfontconfig – this is required by PhantomJS. 

sudo apt-get install libfontconfig

7. PhantomJS is required by Grunt, so install that via npm.

npm install -g phantomjs

8. Install Yeoman. Don’t do this with “sudo”!

npm install -g yo

9. Install ember generator. Don’t do this with “sudo”!

npm install -g generator-ember

 10. Create a project director and cd to that directory.

mkdir my-proj
cd my-proj

11. Create the project scaffolding.

 yo ember

12. Do a bower install in the test directory

cd test
bower install

12. Build the project.

cd ..
grunt

13. Start the application. Checkout the app at localhost:9000 (default port is 9000).

grunt serve

14. I found that the path to NVM is set up temporarily and it gets lost when we exit the shell. So next time, you may find that yo, grunt commands are not in path. To fix this make a permanent entry in the profile file.

Example: export PATH=/home/vagrant/.nvm/v0.10.30/bin:$PATH

Your ember project is initialized and checked out! If you are running the app in a vagrant instance, make sure you replace the server config in Grunt.js

connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0'
            },
...
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s