ThomasTJdev / nim_websitecreator

Nim fullstack website framework - deploy a website within minutes
https://nimwc.org
MIT License
176 stars 7 forks source link

Error install on Linux #139

Closed nixfreak closed 2 years ago

nixfreak commented 2 years ago

Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-1.4.8/config/nim.cfg' [Conf] Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-1.4.8/config/config.nims' [Conf] ................................................. nimwc_main.nim(11, 6) Warning: import os.nim instead; oswalkdir is deprecated [Deprecated] ........................................................................ nimfs/_plugins.nimf(82, 111) Error: type mismatch: got but expected one of: proc getLibravatarUrl(email: var string; size: range[1 .. 512] = 100; default: static[string] = "robohash"; forceDefault: static[bool] = false; baseUrl: static[string] = "https://seccdn.libravatar.org/avatar/") first type mismatch at position: 1 required type for email: var string but expression 'mail' is immutable, not 'var'

expression: getLibravatarUrl(mail)

Steps: 1 - download and install nimwc nimble install nimwc 2 - run nimwc 3 - error

nim c -V Nim Compiler Version 1.4.8 [Linux: amd64] Compiled at 2021-05-25 Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3 active boot switches: -d:release

ThomasTJdev commented 2 years ago

Thanks for reporting it @nixfreak . Could you please try the following procedure below:

$ git clone git@github.com:ThomasTJdev/nim_websitecreator.git
$ cd nim_websitecreator
$ nim c nimwc
$ ./nimwc
nixfreak commented 2 years ago

env/nim/nim_websitecreator/nimwcpkg/webs/captchas.nim(2, 36) Error: cannot open file: recaptcha

ThomasTJdev commented 2 years ago

Hi @nixfreak

You need to install the dependencies. They can be found in the *.nimble. You have 2 options:

Option 1

$ nimble -y install --depsOnly
$ nim c nimwc
$ ./nimwc

Option 2

$ nimble install
nixfreak commented 2 years ago

Sorry I thought I was using 1.6 and it was really 1.0.6 , please accept my apology.

KalStormBYU commented 2 years ago

Hi there.

I'm actually running into the same issues as OP, but didn't want to open a duplicate issue. I've tried the steps you listed here in the issue, but for me it's not changing anything. I initially installed nimwc through nimble, then tried pulling from github directly using git clone https://github.com/ThomasTJdev/nim_websitecreator.git, followed your steps, and still received the error. Any ideas?

Included is the text of the error:

` Compile Error ⚠️ Compile-time or Configuration or Plugin error occurred. ➡️ Check the configuration file of NimWC and enabled plugins. Recompile with -d:contracts. ➡️ Remove new plugins, restore previous configuration. ➡️ ️️Check that you have the latest NimWC version and check the documentation. ➡️ Check your source code: nim check YourFile.nim; nimpretty YourFile.nim

Hint: used config file '/etc/nim/nim.cfg' [Conf] Hint: used config file '/etc/nim/config.nims' [Conf] ................................................. nimwc_main.nim(11, 6) Warning: import os.nim instead; oswalkdir is deprecated [Deprecated] ........................................................................ nimfs/_plugins.nimf(82, 111) Error: type mismatch: got but expected one of: proc getLibravatarUrl(email: var string; size: range[1 .. 512] = 100; default: static[string] = "robohash"; forceDefault: static[bool] = false; baseUrl: static[string] = "https://seccdn.libravatar.org/avatar/") first type mismatch at position: 1 required type for email: var string but expression 'mail' is immutable, not 'var'

expression: getLibravatarUrl(mail) `

ThomasTJdev commented 2 years ago

Yep, we have some legacy features, such as libravatar, which can cause problems. I will see if I can remove those during the weekend.

As OP please ensure, that you are running the latest Nim-version.

nim -v
KalStormBYU commented 2 years ago

Okay, so I updated Nim to the latest version (1.6.4), and the error when trying to run nimwc changed a bit. I appreciate you taking a look at this!

Error:

nimwcpkg/nimwc_main.nim(11, 6) Warning: import os.nim instead; oswalkdir is deprecated [Deprecated] .............................................................. nimwcpkg/constants/_htmls.nim(3, 8) Hint: duplicate import of 'strutils'; previous import here: nimwcpkg/constants/_sqls.nim(3, 6) [DuplicateModuleImport] .......... nimwcpkg/webs/captchas.nim(2, 47) Hint: duplicate import of 'strutils'; previous import here: nimwcpkg/webs/html_utils.nim(1, 8) [DuplicateModuleImport] ....... std/db_sqlite(184, 1) Warning: Circular dependency detected. codeReordering pragma may not be able to reorder some nodes properly [User] ........ nimwcpkg/databases/_backupdbs.nim(6, 99) Warning: Deprecated since 1.5; TaintedString is deprecated [Deprecated] ........... nimwcpkg/utils/loggers.nim(28, 57) Warning: Deprecated since 1.5; TaintedString is deprecated [Deprecated] .......................... nimwcpkg/nimfs/_plugins.nimf(82, 111) Error: type mismatch: got < string > but expected one of: proc getLibravatarUrl(email: var string; size: range[1 .. 512] = 100; default: static[string] = "robohash"; forceDefault: static[bool] = false; baseUrl: static[string] = "https://seccdn.libravatar.org/avatar/") first type mismatch at position: 1 required type for email: var string but expression 'mail' is immutable, not 'var'

expression: getLibravatarUrl(mail)

ThomasTJdev commented 2 years ago

@KalStormBYU - please give it a try

KalStormBYU commented 2 years ago

It works now, thanks so much! Sorry if that was a lot of work, but thanks again for implementing those changes.

ThomasTJdev commented 2 years ago

Thanks for the follow up!