Git Product home page Git Product logo

Comments (24)

sergiokopplin avatar sergiokopplin commented on July 4, 2024 4

Just change this:
return cp.spawn('jekyll', ['build'], {stdio: 'inherit'}).on('close', done);

for this:
return cp.exec('jekyll', ['build'], {stdio: 'inherit'}).on('close', done);

from jekyll-gulp-sass-browser-sync.

maiertech avatar maiertech commented on July 4, 2024 3

To keep your code platform independent, you can add

var jekyll = process.platform === "win32" ? "jekyll.bat" : "jekyll";

and then use

return cp.spawn(jekyll, ['build'], {stdio: 'inherit'}).on('close', done);

from jekyll-gulp-sass-browser-sync.

agragregra avatar agragregra commented on July 4, 2024 1

My new build a starter project with Jekyll and other tools (Win, Mac, Lin): https://github.com/agragregra/jekyll-gulp-autoprefixer-sass-bourbon-jade-browser-sync

from jekyll-gulp-sass-browser-sync.

MuhammadSayedMorsi avatar MuhammadSayedMorsi commented on July 4, 2024 1

hi there! I face this problem and I tried to use the command line prompt with ruby. and worked!

from jekyll-gulp-sass-browser-sync.

shakyShane avatar shakyShane commented on July 4, 2024

Hi there

Sorry I havn't tested this on windows yet - can you compile Jekyll normally from the command line (without using gulp)?

from jekyll-gulp-sass-browser-sync.

maiertech avatar maiertech commented on July 4, 2024

Jekyll works fine on command-line. My workaround is use Grunt to launch BrowserSync.

from jekyll-gulp-sass-browser-sync.

shakyShane avatar shakyShane commented on July 4, 2024

@sergiokopplin have you tested this works on windows?

from jekyll-gulp-sass-browser-sync.

sergiokopplin avatar sergiokopplin commented on July 4, 2024

I tried, without success, had seen this on stackoverflow and it seemed to work.
Incidentally, I went back to using the browser-sync today and I came across many problems and could not use. Other browsers can not connect to internal network of my house. I used both the browser-sync in its simple form, as well as the Grunt and the Gulp.

from jekyll-gulp-sass-browser-sync.

sergiokopplin avatar sergiokopplin commented on July 4, 2024

Updating.

I had a problem on my machine because I could not run the browser-sync, asked for help from friends and some developers still unable to diagnose. I formatted the machine and now it worked without problems.

Follows the line I changed:

('Jekyll', ['build'], {stdio: 'inherit'}) return cp.exec

from jekyll-gulp-sass-browser-sync.

wayferer avatar wayferer commented on July 4, 2024

I had similar issue and used:

return cp.spawn('jekyll.bat', ['build'], {stdio: 'inherit'}).on('close', done);

from jekyll-gulp-sass-browser-sync.

okonet avatar okonet commented on July 4, 2024

It also fails on Mac OS 10.10

--- OSS/jekyll-gulp-sass-browser-sync ‹master› » gulp
[11:57:25] Using gulpfile ~/Projects/OSS/jekyll-gulp-sass-browser-sync/gulpfile.js
[11:57:25] Starting 'sass'...
[11:57:25] Starting 'jekyll-build'...
[11:57:25] Starting 'watch'...
[11:57:25] Finished 'watch' after 10 ms

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)

from jekyll-gulp-sass-browser-sync.

okonet avatar okonet commented on July 4, 2024

I've added an error handler to the gulpfile.js to track the error and here we go:

--- OSS/jekyll-gulp-sass-browser-sync ‹master* M› » gulp
[21:11:14] Using gulpfile ~/Projects/OSS/jekyll-gulp-sass-browser-sync/gulpfile.js
[21:11:14] Starting 'sass'...
[21:11:14] Starting 'jekyll-build'...
[21:11:14] Starting 'watch'...
[21:11:14] Finished 'watch' after 10 ms
Error: spawn ENOENT
[21:11:14] 'jekyll-build' errored after 16 ms
[21:11:14] Error: -1
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
    at Gulp.emit (events.js:95:17)
    at Gulp.Orchestrator._emitTaskDone (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at ChildProcess.cb (/Users/okonet/Projects/OSS/jekyll-gulp-sass-browser-sync/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Still unclear why it's happening. I've installed jekyll using gem install jekyll

which jekyll                                                                                                              
jekyll: aliased to bundled_jekyll

from jekyll-gulp-sass-browser-sync.

okonet avatar okonet commented on July 4, 2024

The problem was the bundler. In this case it should look like:

return cp.spawn('bundle', ['exec', 'jekyll', 'build'], {stdio: 'inherit'})

from jekyll-gulp-sass-browser-sync.

tatygrassini avatar tatygrassini commented on July 4, 2024

Installing another Ruby version worked for me (2.1.6).

from jekyll-gulp-sass-browser-sync.

FTMMM avatar FTMMM commented on July 4, 2024

[15:06:32] Task 'install' is not in your gulpfile
[15:06:32] Please check the documentation for proper gulpfile formatting

What should I do, can anyone help me ?

from jekyll-gulp-sass-browser-sync.

digiprix avatar digiprix commented on July 4, 2024

it doesn't work on windows anyhow... using jekyll independently is good...

from jekyll-gulp-sass-browser-sync.

AcarMeel avatar AcarMeel commented on July 4, 2024

Hi, When I run the command gulp and my browser opens in localhost:3000 I get the error 'Cannot GET /'

from jekyll-gulp-sass-browser-sync.

sergiokopplin avatar sergiokopplin commented on July 4, 2024

@AcarMeel, did you checked another url like "localhost:3000/index.html"? Or maybe with your application folder. In my case my url is like "localhost:3000/app/index.html"

from jekyll-gulp-sass-browser-sync.

AcarMeel avatar AcarMeel commented on July 4, 2024

@sergiokopplin but in my _site folder I don't have any html file (index.html) . Is not compiling any html files just the styles.

from jekyll-gulp-sass-browser-sync.

steven-to avatar steven-to commented on July 4, 2024

anyone found a solution for this script on Windows? I tried lots of methods but none seems to work, I'm using this on Windows 10. Thanks in advanced!

*Edit: Okay, so I used the code below:

gulp.task('jekyll-build', function (done){
    //var jekyll = process.platform === "win32" ? "jekyll.bat" : "jekyll";
    return cp.spawn('jekyll.bat', ['build'], {stdio: 'inherit'})
        .on('close', done);
});

and it worked, but I had to exclude node_modules in my _config.yml. And also my rebuild task is taking a bit slow, I will try to optimize it and post the code here :)
Thanks Shane for making this script! 👍

from jekyll-gulp-sass-browser-sync.

steven-to avatar steven-to commented on July 4, 2024

This is my gulpfile for Jekyll to work with Gulp on Windows (10), anyone who want the script please feel free to download and use it and also Star the repo if you like it :)
Again thanks Shane for uploading the original work, mine just has different structures and modified gulpfile so it can work on Windows.

https://github.com/steven-to/gulp-jekyll-browsersync/blob/gh-pages/gulpfile.js

from jekyll-gulp-sass-browser-sync.

duzyn avatar duzyn commented on July 4, 2024

You can use gulp-shell to run jekyll or bunlde exec jekyll

var shell       = require('gulp-shell');

// Task for building blog when something changed:
gulp.task('jekyll-build', shell.task(['bundle exec jekyll build']));
// Or if you don't use bundle:
// gulp.task('build', shell.task(['jekyll build']));

from jekyll-gulp-sass-browser-sync.

gangsthub avatar gangsthub commented on July 4, 2024

nah, you shouldn't.

"gulp-shell": "promotes anti-patterns, use gulp-exec or child_process"

https://github.com/gulpjs/plugins/blob/master/src/blackList.json

from jekyll-gulp-sass-browser-sync.

thanooshan avatar thanooshan commented on July 4, 2024

Yeah! like @MuhammadSayedMorsi said windows users please use the 'command line prompt with ruby' to run the gulp. It will work!.

from jekyll-gulp-sass-browser-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.