digitalfreedom / website

Jekyll site generator for DFA
https://digitalfreedom.io
4 stars 4 forks source link

New NPM build process throws Ruby Gem errors #17

Open bnvk opened 9 years ago

bnvk commented 9 years ago

@peterjaric major thanks for for the awesome improvements and improvements to the JS build stuff- that absolutely needed doing :+1: i'm more of a browserify guy than webpack, but am always up for learning new tools!

I've never used NPM to control Ruby or Jekyll for that matter. Upon merging in your changes on my dev machine, i'm getting a bunch of errors running npm run watch see below. It seems to complete all the JS / webpack compilation, but then fails at the Ruby step. It's worth noting that using Jekyll standalone still works fine as well.

Any things I need to configure or let my system know about so node knows where my Ruby is and such?

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.1/gems/eventmachine-1.0.7 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/eventmachine-1.0.7/gem_make.out
    from /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
    from /usr/share/ruby/tempfile.rb:324:in `open'
    from /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:17:in `build'
    from /usr/share/rubygems/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:160:in `chdir'
    from /usr/share/rubygems/rubygems/ext/builder.rb:160:in `block in build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:159:in `synchronize'
    from /usr/share/rubygems/rubygems/ext/builder.rb:159:in `build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:198:in `block in build_extensions'
    from /usr/share/rubygems/rubygems/ext/builder.rb:195:in `each'
    from /usr/share/rubygems/rubygems/ext/builder.rb:195:in `build_extensions'
    from /usr/share/rubygems/rubygems/specification.rb:1436:in `block in build_extensions'
    from /usr/share/rubygems/rubygems/user_interaction.rb:45:in `use_ui'
    from /usr/share/rubygems/rubygems/specification.rb:1434:in `build_extensions'
    from /usr/share/rubygems/rubygems/stub_specification.rb:60:in `build_extensions'
    from /usr/share/rubygems/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
    from /usr/share/rubygems/rubygems/specification.rb:925:in `block in find_inactive_by_path'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `each'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `find'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `find_inactive_by_path'
    from /usr/share/rubygems/rubygems.rb:185:in `try_activate'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
    from <internal:abrt_prelude>:2:in `<compiled>'

extconf failed, exit code 1

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.1/gems/eventmachine-1.0.7 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/eventmachine-1.0.7/gem_make.out
    from /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
    from /usr/share/ruby/tempfile.rb:324:in `open'
    from /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:17:in `build'
    from /usr/share/rubygems/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:160:in `chdir'
    from /usr/share/rubygems/rubygems/ext/builder.rb:160:in `block in build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:159:in `synchronize'
    from /usr/share/rubygems/rubygems/ext/builder.rb:159:in `build_extension'
    from /usr/share/rubygems/rubygems/ext/builder.rb:198:in `block in build_extensions'
    from /usr/share/rubygems/rubygems/ext/builder.rb:195:in `each'
    from /usr/share/rubygems/rubygems/ext/builder.rb:195:in `build_extensions'
    from /usr/share/rubygems/rubygems/specification.rb:1436:in `block in build_extensions'
    from /usr/share/rubygems/rubygems/user_interaction.rb:45:in `use_ui'
    from /usr/share/rubygems/rubygems/specification.rb:1434:in `build_extensions'
    from /usr/share/rubygems/rubygems/stub_specification.rb:60:in `build_extensions'
    from /usr/share/rubygems/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
    from /usr/share/rubygems/rubygems/specification.rb:925:in `block in find_inactive_by_path'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `each'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `find'
    from /usr/share/rubygems/rubygems/specification.rb:924:in `find_inactive_by_path'
    from /usr/share/rubygems/rubygems.rb:185:in `try_activate'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
    from <internal:abrt_prelude>:2:in `<compiled>'
npm ERR! weird error 1
npm ERR! not ok code 0
peterjaric commented 9 years ago

I'm sorry to not be able to help, but the build process improvements were added by @eschaefer. He deserves all praise and I'm sure he can answer your questions.

peterjaric commented 9 years ago

But I might add that it works fine on my Linux machine (and I don't use Ruby normally, either, I had to install Ruby).

eschaefer commented 9 years ago

@bnvk super strange that ruby would throw an error here. The npm task runner is just launching jekyll concurrently with webpack. But yeah, maybe npm needs to know which ruby version is active in rvm. Looking into it...

bnvk commented 9 years ago

@eschaefer cool thanks for checking it out for me. @peterjaric oops :P thanks again you two for helping out. Great to have help, open source FTW :grin:

eschaefer commented 9 years ago

@bnvk does the same error occur when you run npm run build as well?

Also, try to change the watch task in package.json to only launch jekyll and see if that even works, for example:

"watch": "jekyll serve --watch --config _config.yml,_config-dev.yml",

Just curious at which point the task/config is failing for ya.

eschaefer commented 9 years ago

@bnvk Another idea since you're using rvm to manage ruby... maybe specify a version of ruby in the node watch task?

For example (based on the current watch task)...

 "watch": "webpack --progress --colors --watch & rvm ruby-2.0.0-p576 ; jekyll serve --watch --config _config.yml,_config-dev.yml",