Trouble downloading yeoman yo; yo: command not found - ruby-on-rails

I am trying to install node and yeoman. I was following this link:
http://yeoman.io/codelab/setup.html
After getting the errors below, I tried a bunch of solutions found here:
Node package ( Grunt ) installed but not available
But it did not work.
I was able to do sudo npm install -g bower and sudo npm install -g grunt and sudo npm install -g yo, but only yo seems to not be able to download.
/Users/myname/npm/bin/yeoman -> /Users/myname/npm/lib/node_modules/yeoman/bin/yeoman
/Users/myname/npm/bin/_yeomaninsight -> /Users/myname/npm/lib/node_modules/yeoman/bin/yeomaninsight.py
yeoman#0.9.6 /Users/myname/npm/lib/node_modules/yeoman
├── which#1.0.5
├── open#0.0.2
├── colors#0.6.2
├── mkdirp#0.3.5
├── faye-websocket#0.4.4
├── fstream#0.1.26 (inherits#2.0.1, graceful-fs#3.0.2)
├── rimraf#2.0.3 (graceful-fs#1.1.14)
├── shelljs#0.0.9
├── request#2.9.203
├── tar#0.1.19 (inherits#2.0.1, block-stream#0.0.7)
├── grunt-contrib-coffee#0.3.2 (grunt-lib-contrib#0.3.1)
├── coffee-script#1.3.3
├── html-minifier#0.4.5
├── fstream-ignore#0.0.5 (inherits#1.0.0, minimatch#0.2.14)
├── grunt-jasmine-task#0.2.3 (temporary#0.0.8)
├── requirejs#2.0.6
├── grunt-mocha#0.1.7 (growl#1.7.0, temporary#0.0.8)
├── clean-css#0.3.3 (optimist#0.1.9)
├── cheerio#0.9.2 (underscore#1.6.0, entities#0.5.0, htmlparser2#2.6.0, cheerio-select#0.0.3)
├── es6-collections#0.2.0
├── connect#2.2.2 (qs#0.4.2, mime#1.2.4, debug#1.0.2, crc#0.1.0, formidable#1.0.9)
├── bower#0.3.2 (stable#0.1.5, archy#0.0.2, semver#1.1.4, async#0.1.22, tmp#0.0.23, nopt#2.0.0, lodash#0.9.2, vows#0.6.4, glob#3.1.21, rc#0.0.8, read-package-json#0.1.13, request#2.11.4, hogan.js#2.0.0)
├── prompt#0.1.12 (async#0.1.22, pkginfo#0.3.0, winston#0.5.11)
├── grunt#0.4.0-a (dateformat#1.0.2-1.2.3, semver#1.0.14, async#0.1.22, hooker#0.2.3, nopt#1.0.10, temporary#0.0.8, underscore#1.3.3, underscore.string#2.1.1, glob-whatev#0.1.8, gzip-js#0.3.2, uglify-js#1.2.6, jshint#0.7.3, nodeunit#0.7.4)
└── yeoman-generators#0.9.5 (diff#1.0.8, mime#1.2.11, cheerio#0.10.8)
mynames-MacBook:~ myname$ yo --version
-bash: yo: command not found

Related

golang docker build for linux

I need to compile a Golang application for Linux and I can't cross-compile under Mac, because of another library. So I decided to compile within a Docker container. This is my first time to use Docker.
This is my current directory structure:
.
├── Dockerfile
├── Gopkg.lock
├── Gopkg.toml
├── Vagrantfile
├── bootstrap.sh
├── src
│   ├── cmd
│   │   ├── build.bat
│   │   ├── build.sh
│   │   ├── config.json
│   │   ├── readme.md
│   │   └── server.go
│   ├── consumers.go
│   ├── endpoints
│   │   ├── json.go
│   │   ├── rate.go
│   │   ├── test_payment.go
│   │   └── wallet.go
│   ├── middleware
│   │   └── acl.go
│   ├── models.go
│   ├── network
│   │   └── network.go
│   ├── qr
│   │   └── qr.go
│   ├── router
│   │   └── router.go
│   ├── service
│   │   └── walletService.go
│   ├── services.go
│   ├── setup.sql
│   ├── store
│   │   └── wallet.go
│   ├── stores.go
│   └── wallet
│   ├── coin.go
│   └── ethereum.go
Dockerfile:
FROM golang:latest
WORKDIR /src/cmd
RUN ls
RUN go get github.com/go-sql-driver/mysql
RUN go build -o main ./src/cmd/server.go
CMD ["./main"]
I try to build the Docker image with:
docker build -t outyet .
This is the error it returns:
Sending build context to Docker daemon 5.505MB
Step 1/6 : FROM golang:latest
---> d0e7a411e3da
Step 2/6 : WORKDIR /src/cmd
---> Using cache
---> 0c4c2b99e294
Step 3/6 : run ls
---> Using cache
---> 23d3e491a2e1
Step 4/6 : RUN go get github.com/go-sql-driver/mysql
---> Running in f34447e51f6c
Removing intermediate container f34447e51f6c
---> 5731ab22ee43
Step 5/6 : RUN go build -o main server.go
---> Running in ecc48fcf5488
stat server.go: no such file or directory
The command '/bin/sh -c go build -o main server.go' returned a non-zero code: 1
How i can build my Golang application with docker?
The error you're seeing is:
stat server.go: no such file or directory
The command '/bin/sh -c go build -o main server.go' returned a non-zero code: 1
... and in other words, it's telling you that the Go compiler can't find server.go which you're trying to build. Update your Dockerfile to copy your local files into the Docker image:
FROM golang:latest
COPY . /go/src/workdir
WORKDIR /go/src/workdir
RUN go build -o main ./src/cmd/server.go
CMD ["/go/src/workdir/main"]
In your directory I spotted Gopkg.toml which is a dependency manifest used by dep. dep will use a directory called vendor to include all dependencies for your Go project. Before you build the Docker image, you need to ensure all dependencies are present with dep ensure:
$ dep ensure
$ docker build -t outyet .
You need to add your sources in your build container. Add this line in your Dockerfile (after FROM golang:latest for example) :
ADD src/ /src/cmd
Then, you could access files inside the container (/src/cmd) : RUN ls should now return something.

Dockerfile COPY instruction failing with explicit file reference

If my project structure is like this:
├── compose
│   ├── local
│   │   └── django
│   │   ├── Dockerfile
│   │   ├── celery
│   │   │   ├── beat
│   │   │   │   └── start.sh
│   │   │   └── worker
│   │   │   └── start.sh
│   │   └── start.sh
│   └── production
│   ├── caddy
│   │   ├── Caddyfile
│   │   └── Dockerfile.caddy
│   ├── django
│   │   ├── Dockerfile.django
I am calling from root, $  heroku container:push --recursive
However, build will fail citing COPY fail:
Sending build context to Docker daemon 3.072kB
Step 1/2 : FROM abiosoft/caddy:0.10.6
---> d8ff070e1cee
Step 2/2 : COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile
COPY failed: stat /var/lib/docker/tmp/docker-builder022230374/compose/production/caddy/Caddyfile: no such file or directory
▸ Error: docker build exited with 1
The actual Dockerfile:
FROM abiosoft/caddy:0.10.6
COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile
I have read this similar stackoverflow post: Dockerfile COPY instruction failing?
Per the top answer, I did believe I'm referencing the file explicitly at build.
I guess not. What am I missing?

Why docker ADD destroys folder structure?

I have the following folder structure:
> tree -L 3
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   └── resources
│   └── test
│   ├── groovy
│   └── resources
I tried to build docker image containing those folders together with files using the following Dockerfile:
FROM jamesdbloom/docker-java8-maven
USER root
RUN mkdir src
ADD ./src/* ./src/
ADD pom.xm
However, the structure in docker image is different. Particularly, I can no longer find main and test folders.
$ tree -L 3
.
├── pom.xml
├── src
│   ├── groovy
│   │   └── com
│   ├── java
│   │   └── com
│   └── resources
│   ├── ext_sample_input.json
│   ├── hist_sample_input.json
│   └── sample_input.json
Why is it so?
From official documentation:
Note: The directory itself is not copied, just its contents.
Change your ADD statement to:
ADD ./src ./src/

Gulp throwing error when running gulp images

I am unable to run gulp images.
This is what I have installed on my computer:
├── async#0.9.2
├── bower#1.3.12
├── browser-sync#2.1.6
├── chai#1.10.0
├── colors#1.1.2
├── glob#4.5.3
├── glob-all#3.0.1
├── gulp#3.9.0
├── gulp-changed#1.3.0
├── gulp-clean#0.3.1
├── gulp-compass#2.0.4
├── gulp-concat#2.5.2
├── gulp-flatten#0.0.4
├── gulp-gm#0.0.7
├── gulp-jsonminify#1.0.0
├── gulp-plumber#0.6.6
├── gulp-rename#1.2.2
├── gulp-template-compile#0.2.1
├── gulp-uglifyjs#0.6.2
├── imagemin-jpegoptim#4.0.0
├── imagemin-optipng#4.3.0
├── imagemin-pngquant#4.2.0
├── js-yaml#3.4.2
├── lodash#3.10.1
├── merge-stream#0.1.8
├── mocha#2.3.2
├── run-sequence#1.0.2
└── should#4.6.5
And this is the error that gets flagged when I run gulp images:
Invalid image: /###/card/6997479627_922084ec63-card.jpg
[11:54:10] Plumber found unhandled error:
Error in plugin 'gulp-gm'
I've tried uninstalling and reinstalling gulp, graphicsmagick, and imagemagick but it still flags the error.
Thanks for your help
I would install the latest version of gulp-gm, image manipulation with GraphicsMagick for gulp.

pub serve Transformer library "package:observe/transformer.dart" not found

When run pub serve on Mac, it could not find transformer.dart:
Transformer library "package:observe/transformer.dart" not found
I'm using OSX 10.9, DartEditor 30798.
pub build works fine.
I searched and saw pub build fails if proxy is define. But I'm connecting to network directory without proxy.
Here is the observe package under packages directory, transformer.dart is there:
observe
├── html.dart
├── observe.dart
├── src
│   ├── bind_property.dart
│   ├── change_notifier.dart
│   ├── change_record.dart
│   ├── compound_path_observer.dart
│   ├── dirty_check.dart
│   ├── list_diff.dart
│   ├── list_path_observer.dart
│   ├── metadata.dart
│   ├── microtask.dart
│   ├── observable.dart
│   ├── observable_box.dart
│   ├── observable_list.dart
│   ├── observable_map.dart
│   ├── path_observer.dart
│   └── to_observable.dart
├── transform.dart
└── transformer.dart
I had such problem in the renamed polymer project. After I made new polymer project and copy all logic in created files. The problem was solved.

Resources