Discourse Theme CLI (console app to help you build themes)

I’m getting the following running “discourse_theme new mytheme” on mac

/Library/Ruby/Gems/2.3.0/gems/discourse_theme-0.3.0/lib/discourse_theme/cli.rb:62:in run': undefined methodempty?’ for Dir:Class (NoMethodError)
from /Library/Ruby/Gems/2.3.0/gems/discourse_theme-0.3.0/bin/discourse_theme:5:in <top (required)>' from /usr/local/bin/discourse_theme:22:inload’
from /usr/local/bin/discourse_theme:22:in `’

1 Like

It looks like you’re running an old version of Ruby. We recommend using 2.6.2 at the moment. Dir.empty? was added in ruby 2.4.


I just pushed an update to rubygems (v0.3.2) which switches the CLI to use header-based API key authentication. Update your local copy to avoid causing warning messages in your admin dashboard.



I’m getting Error 403 when trying to run watch for first time.
Console output:
discourse_theme watch .
» Using mywebsize.com from /Users/davidpesava/.discourse_theme
» Using api key from /Users/davidpesava/.discourse_theme
✘ Error 403 for https://mywebsite.com/about.json

Did you create a user api key? And that user needs to be an admin.

yes, key is in .discourse_theme and user is admin

I would recommend resetting the authentication information and trying again. Add --reset to the watch command, and re-enter the API details.

Just to confirm - it is attached to an admin user, not an “all users” key?


Tried it multiple times , but still not working

yes, key is for one user that is admin

Did you solve the problem? I am in the same problem with local installation. Whereas doing it with Theme creator work without issues I try with my local installation (because I need to check the theme with my local installation that has some plugins) but I am not able to do so. I got:

» Using http://localhost:3000 from /Users/alexis/.discourse_theme
» Using api key from /Users/alexis/.discourse_theme
✘ Error 403 for http://localhost:3000/about.json: You are not permitted to view the requested resource. The API username or key is invalid.

Make sure that you’re using a User API key and not an “all-user” api key?


BTW, I read and works and then I didn’t say thanks a lot @pfaffman