Calamitous / iris

Serverless command-line forum software
GNU General Public License v2.0
62 stars 4 forks source link

error when running iris first time #62

Closed lee2sman closed 5 months ago

lee2sman commented 11 months ago

Hi, I'm the admin of a server and trying to install iris. Just after a fresh install, I moved iris to /usr/local/bin and made it executable by all. Upon first run it asked me to create a fresh message file. After re-running iris, I get this error.

Welcome to Iris v1.1.2.  Type 'help' for a list of commands; Ctrl-D or 'quit' to leave.

You're all caught up!  No new topics to read.
/usr/local/bin/iris:42:in `hostname': undefined method `compact' for nil:NilClass (NoMethodError)

    @hostname = hostname.split('.')[-2..-1].compact.join('.')
                                           ^^^^^^^^
    from /usr/local/bin/iris:47:in `author'
    from /usr/local/bin/iris:906:in `prompt'
    from /usr/local/bin/iris:915:in `initialize'
    from /usr/local/bin/iris:902:in `new'
    from /usr/local/bin/iris:902:in `start'
    from /usr/local/bin/iris:1076:in `initialize'
    from /usr/local/bin/iris:1133:in `new'
    from /usr/local/bin/iris:1133:in `<main>'
lee2sman commented 11 months ago

I commented out that line 42 and have had no ill effects so far and now finally iris runs for all users. I'm running ruby 3.2.2.

unbeatable-101 commented 9 months ago

ctrl-c.club runs ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu], the newer version might be the source of the issue.

towynlin commented 9 months ago

I'm pretty sure the issue here is that the hostname is a single word. I created a pull request to handle that case, adding a unit test that was failing before the PR. Cheers!