No such file or directory - convert (Errno::ENOENT)

AI-generated summary

codergautam encountered a No such file or directory - convert (Errno::ENOENT) error while setting up Discourse for development on Windows 11 using WSL, following a tutorial. The error originated in letter_avatar.rb and pointed to a missing convert command, suggesting ImageMagick wasn’t installed. Arkshine asked which Linux distro was used (assuming Ubuntu 22) and requested output of convert --version to verify ImageMagick’s presence. They also noted the user’s Node.js version (v16) was unexpected, as the installer should have set up v18. codergautam explained they manually installed dependencies due to script failures and speculated that installing ImageMagick via apt might have resolved the issue — but ultimately, re-running the original installer script fixed everything. Arkshine followed up, asking for details on where and why the script failed, noting they’ve successfully installed Discourse multiple times on fresh Ubuntu 22 (including on Windows 11) without issues. The root cause appears to be an incomplete or failed initial installation script, which left ImageMagick uninstalled, triggering the convert error during Rails preloading.

Trying to run Discourse dev on Windows 11 , following this tutorial.

Versions:

Getting the following error, any idea why?

gautam@gautampc:~/discourse$ DISCOURSE_HOSTNAME=localhost UNICORN_LISTENER=localhost:3000 bin/ember-cli -u
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
patch-package 8.0.0
Applying patches...
babel-plugin-debug-macros@0.3.4 ✔
content-tag@1.1.2 ✔
ember-source@3.28.12 ✔
ember-this-fallback@0.4.0 (1 deprecation-name) ✔
ember-this-fallback@0.4.0 (2 themes) ✔
virtual-dom@2.1.1 ✔
Ember CLI running on PID: 6112
I, [2023-11-19T21:59:31.189585 #6136]  INFO -- : Refreshing Gem list
Starting CSS change watcher
I, [2023-11-19T21:59:32.402308 #6136]  INFO -- : listening on addr=127.0.0.1:3000 fd=24
#<Thread:0x00007ff72c9dac30 /home/gautam/discourse/lib/discourse.rb:1157 run> terminated with exception (report_on_exception is true):
/home/gautam/discourse/lib/letter_avatar.rb:112:in ``': No such file or directory - convert (Errno::ENOENT)
        from /home/gautam/discourse/lib/letter_avatar.rb:112:in `image_magick_version'
        from /home/gautam/discourse/lib/discourse.rb:1157:in `block in preload_rails!'
Proxying to http://localhost:3000
E, [2023-11-19T21:59:33.033584 #6136] ERROR -- : No such file or directory - convert (Errno::ENOENT)
/home/gautam/discourse/lib/letter_avatar.rb:112:in ``'
/home/gautam/discourse/lib/letter_avatar.rb:112:in `image_magick_version'
/home/gautam/discourse/lib/discourse.rb:1157:in `block in preload_rails!'
- building...
[bin/ember-cli] unicorn process stopped. Terminating ember-cli.

What Linux did you install Discourse on? (Unless you modified the script, I would assume Ubuntu 22)

Can you share the output of convert --version? I’m wondering if ImageMagick is properly installed.

As a side note, it’s odd you have node v16; the script installed node v18. :thinking:

Turns out the script didn’t install properly for some reason so I was manually installing node and the other deps as I ran into issues with commands :grimacing:. I think it would’ve worked if I just installed ImageMagick from apt, but I did re run the initial installer script and that fixed it.

Thanks!

Can you share what issue happened, and where the script failed?

I installed Discourse on a fresh Ubuntu 22 several times (windows 11 as well), and it works without issue.