Search code examples
rubyrakestructured-datalinter

Structured Data Linter ruby installation problem


I have a relatively big corpus of structured data, which I need to validate. I am planning to use Ruby Structured Data Linter from this repo https://github.com/structured-data/linter to automate the validation. After cloning the repo and installation of all required packages when I try to run

rake schema:examples

I get an error

C:\Users\anast\Projects\Schema\linter>rake schema:examples
rake aborted!
LoadError: cannot load such file -- rdf/linter
C:/Users/anast/Projects/Schema/linter/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)

How can I fix this? It's worth to mention that I already tried to add the lib folder to PATH.

C:\Users\anast\Projects\Schema\linter>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby27/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: C:/Users/anast/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: C:/Ruby27/bin/ruby.exe
  - GIT EXECUTABLE: C:\Program Files\Git\cmd/git.EXE
  - EXECUTABLE DIRECTORY: C:/Ruby27/bin
  - SPEC CACHE DIRECTORY: C:/Users/anast/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby27/lib/ruby/gems/2.7.0
     - C:/Users/anast/.gem/ruby/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - C:\Windows\system32
     - C:\Windows
     - C:\Windows\System32\Wbem
     - C:\Windows\System32\WindowsPowerShell\v1.0\
     - C:\Windows\System32\OpenSSH\
     - "C:\MinGW\bin
     - C:\MinGW\msys\1.0\bin"
     - C:\Users\anast\AppData\Local\Programs\Python\Python38
     - C:\Program Files\Git\cmd
     - C:\Program Files (x86)\swigwin-4.0.2
     - C:\Program Files\nodejs\
     - C:\Users\anast\Projects\Schema\linter\lib
     - C:\Ruby27\bin
     - C:\Ruby26\bin
     - C:\Users\anast\AppData\Local\Microsoft\WindowsApps
     -
     - C:\Program Files\JetBrains\PyCharm 2020.1.4\bin
     -
     - C:\Users\anast\AppData\Local\Programs\Microsoft VS Code\bin
     - C:\Users\anast\AppData\Roaming\npm

I have absolutely no experience with ruby so would be grateful for any help :)


Solution

  • You have 2 ruby binary paths in your $PATH variable, but it looks like you need to remove C:\Ruby26\bin

    Any ruby script or program which contains a Gemfile you need to install the dependencies by the following steps:

    cd into the root of the project and run these commands

    gem install rubygems
    gem install bundler
    bundle install
    

    Then try to run your rake commands again. But also the documentation for this project says to run

    bundle install --path vendor/bundler
    

    The instructions on the setup and how to actually run this project are not exactly clear but make sure to check the setup notes section which appear to conflict somewhat with instructions for running locally

    I would try both methods after getting your PATH fixed and dependencies installed properly. I'm not on Windows but if you may need to refer to answers to this question for help with that.