byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

Interpreter error: Could not find module 'Diagrams.Prelude' or 'Diagrams.Backend.Rasterific' #24

Closed sid-kap closed 8 years ago

sid-kap commented 8 years ago

Here is the output I get when I run BlogLiteratelyD test.md on the example from https://www.stackage.org/lts-3.20/package/BlogLiterately-diagrams-0.2.0.1:


Interpreter error:
/tmp/sidharth/Diagram1804289383846930886.hs:4:8:
    Could not find module ‘Diagrams.Prelude’
    Use -v to see a list of the files searched for.
/tmp/sidharth/Diagram1804289383846930886.hs:5:8:
    Could not find module ‘Diagrams.Backend.Rasterific’
    Use -v to see a list of the files searched for.

<p>NOTE: Square brackets below should be replaced by curly braces. Haddock chokes on curly braces.</p>
<p>Here is a green square:</p>
<pre><code>dia = gSq
Interpreter error:
/tmp/sidharth/Diagram1804289383846930886.hs:4:8:
    Could not find module ‘Diagrams.Prelude’
    Use -v to see a list of the files searched for.
/tmp/sidharth/Diagram1804289383846930886.hs:5:8:
    Could not find module ‘Diagrams.Backend.Rasterific’
    Use -v to see a list of the files searched for.
</code></pre>
<p>Green squares like <code>gSq</code>[.dia height=‘16’] and blue circles like <code>circle 1 # fc blue</code>[.dia height=‘16’] are extremely important.</p>
<div id="references" class="references">

</div>

Even after running stack install diagrams-lib diagrams-rasterific, I still get the same error. How do I make sure that BlogLiteratelyD is loading the correct libraries before running?

byorgey commented 8 years ago

How did you install BlogLiteratelyD?

sid-kap commented 8 years ago

stack install BlogLiterately-diagrams (global install)

byorgey commented 8 years ago

And then how do you run it? stack exec BlogLiteratelyD test.md ?

byorgey commented 8 years ago

Running it from a global install is probably not going to work since it needs to have the diagrams packages in the current package DB (so that it can compile diagrams code).

sid-kap commented 8 years ago

That solves my problem! BlogLiteratelyD test.md did not work, but stack exec BlogLiteratelyD test.md works. Thanks so much for your help!

byorgey commented 8 years ago

Great!