Skip to content

Instantly share code, notes, and snippets.

@skplunkerin
Last active November 26, 2016 06:53
Show Gist options
  • Save skplunkerin/92d5a3edf70f47bc3289 to your computer and use it in GitHub Desktop.
Save skplunkerin/92d5a3edf70f47bc3289 to your computer and use it in GitHub Desktop.
chromebook dev setup using crouton recipe

Following my comment on this blog post:

http://www.wyliethomas.com/blog/2014/04/12/chromebook-for-web-development/


get into developer mode.

####(This wipes all the memory, so backup anything local) esc + refresh then tap power

This is now in recovery mode.

A nasty warning screen will show up

ctrl + D

Another nasty warning screen

ctrl + D

It will take about 10 minutes.

From now on, every reboot you'll need to:

ctrl + D (or wait 30 seconds)

###NOTE: ctrl + alt + --> then <-- switches between Chrome OS & chronos dev terminal window

(this is available once Chrombook is in dev mode)


Download crouton.

http://goo.gl/fd3zc

Open terminal, type:

ctrl + alt + t

shell

Check if crouton has the ubuntu version you want

(for me it's 14.04 LTS)

sh -e ~/Downloads/crouton -r list

Find the ubuntu code name

(14.04 LTS == trusty)

List out options for installing

sh -e ~/Downloads/crouton -t help

Let’s install trusty (desktop ubuntu version)

sudo sh -e ~/Downloads/crouton -r trusty -n ubuntu -t cli-extra

sudo sh -e ~/Downloads/crouton -r trusty -n ubuntu -t unity,keyboard,extension,cli-extra

sudo enter-chroot

sudo startunity

###NOTE: ctrl + shift + alt + <-- or --> switches between Chrome OS & Unity

Open xterm

sudo apt-get update

Install gnome-terminal (so .bashrc && .profile work)

sudo apt-get install gnome-terminal

Close xterm and start using Terminal


Get my php environment working

sudo apt-get install php5 apache2 mysql-server php5-cli php5-mysql

sudo a2enmod rewrite

sudo service apache2 restart

sudo apt-get install git php5-curl sendmail

sudo apt-get install ruby nodejs curl vim


Install RVM

\curl -sSL https://get.rvm.io | bash

If prompted, then:

source /home/***USERNAME****/.rvm/scripts/rvm

Setup your ruby version and default to it

rvm install 1.9.3-head

rvm --default 1.9.3-head

rvm use 1.9.3-head --default

Install some gems

gem install bundler

gem install rails

Install this! (needed in order for gem install mysql2 to work)

sudo apt-get install libmysqlclient-dev


Test rails to make sure it’s working

Before testing

I add my user to group www

then give that group/permissions to the /var/www/ directory

cd /var/

sudo addgroup www

sudo usermod -aG www username

sudo chown -R root:www www/

sudo chmod -R g+w www/

I needed to exit chroot for my permissions to be updated so I can create a rails project

exit

sudo enter-chroot

cd /var/www/

rails new testing

VIOLA!

Now lets delete this test

(unless you want to continue testing it)

sudo rm -r testing/


Let’s see if mysql works

mysql -u root -p

If you get this error:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

You'll always need to start the service

sudo /etc/init.d/mysql start

Try again

mysql -u root -p

BAM!


Test that apache is working

(Type in localhost in a browser tab)

if “Apache2 Ubuntu Default Page” loads, YAY!!!

Update /etc/apache/sites-available/000-default.conf

Change:

DocumentRoot /var/www/html

to:

DocumentRoot /var/www

Then restart apache

sudo service apache2 restart


Let’s test rails

cd /var/www/your-rails-project/

rails s

(Type in http://0.0.0.0:3000 in a browser tab)

It loads… YAY!

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