robwierzbowski / generator-jekyllrb

Supercharge Jekyll development with Yeoman. Yo, Jekyllrb!
BSD 3-Clause "New" or "Revised" License
595 stars 65 forks source link

`yo jekyllrb` not working #142

Open githubutilities opened 9 years ago

githubutilities commented 9 years ago

I install generator-jekyllrb, run yo jekyllrb and I got this error. I think it got a bug in it.

/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:4586
        throw e;
              ^
TypeError: undefined is not a function
    at Generator.run (/usr/local/lib/node_modules/generator-jekyllrb/node_modules/yeoman-generator/lib/base.js:444:21)
    at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:330:20)
    at module.exports (/usr/local/lib/node_modules/yo/lib/routes/run.js:20:11)
    at Router.navigate (/usr/local/lib/node_modules/yo/lib/router.js:36:30)
    at PromptUI.completed (/usr/local/lib/node_modules/yo/lib/routes/home.js:76:20)
    at PromptUI.onCompletion (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/ui/prompt.js:69:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1929:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1866:14)
    at AutoDetachObserverPrototype.completed (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:4604:23)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1866:14)
fjcero commented 9 years ago

I can see the same behavior :(

johnfmorton commented 9 years ago

I'm having the same issues (or at least similar issues) in using yo jekyllrb to initialize a directory.

I'm setting up a new machine and trying to get this generator to work but am getting similar errors thrown by "rx.js".

I've tried this with various combinations of Ruby versions and Node versions by using rvm and nvm. I've tried Ruby versions 2.1.4 and 2.2.0. I've tried npm versions 0.10.36 and 0.12.0.

In all cases I'm getting the following error. Unfortunately in reading these errors I'm confused about where the problem might be.

/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:580
    throw e;
          ^
TypeError: Cannot read property 'name' of undefined
    at Prompt.render (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/lib/prompts/list.js:99:69)
    at Prompt.onSubmit (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/lib/prompts/list.js:127:16)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1940:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1872:35)
    at AnonymousObserver.tryCatcher (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:568:29)
    at AutoDetachObserverPrototype.next (/Users/john/.nvm/v0.10.36/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:4871:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Use~/Sites/jekyll

Here's a look at the environment that created this error message above.

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.6
  - RUBY VERSION: 2.1.4 (2014-10-27 patchlevel 265) [x86_64-darwin14.0]
  - INSTALLATION DIRECTORY: /Users/john/.rvm/gems/ruby-2.1.4
  - RUBY EXECUTABLE: /Users/john/.rvm/rubies/ruby-2.1.4/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/john/.rvm/gems/ruby-2.1.4/bin
  - SPEC CACHE DIRECTORY: /Users/john/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/john/.rvm/rubies/ruby-2.1.4/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-14
  - GEM PATHS:
     - /Users/john/.rvm/gems/ruby-2.1.4
     - /Users/john/.rvm/gems/ruby-2.1.4@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/john/.nvm/v0.10.36/bin
     - /Users/john/.rvm/gems/ruby-2.1.4/bin
     - /Users/john/.rvm/gems/ruby-2.1.4@global/bin
     - /Users/john/.rvm/rubies/ruby-2.1.4/bin
     - /Users/john/.rvm/bin
     - /Users/john/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

Any suggestions?

johnfmorton commented 9 years ago

Ok, upon more investigation, I've noticed I get the above error "Cannot read property 'name' of undefined" only when I don't pick one of the 2 template options. If I leave it to pick the default for me, this error occurs. This makes me think the error I had and the ones mentioned earlier here are not the same error.

egermano commented 9 years ago

I've got the same error, but I didn't installed a Jekyll in my environment.

I just ran gem install jekyll before yo jekyllrb and works.

johnfmorton commented 9 years ago

I've tried uninstalling my global jekyll with sudo rmwhich jekyll` which did uninstall it.

I then installed again while in the directory I was trying to build into using gem install jekyll before yo jekyllrb like you've suggested. No dice on my end. Still producing the same errors for me. :-/

pbirkholz commented 9 years ago

This issue appears to be solved with baf6f238db1b5b260731799b57035da7e27c78e4, however this fix hasn't been published to npm, yet. Hence installing with npm install -g generator-jekyllrb will result in above mentioned error while using the GitHub version directly will work just fine.