# Restore backup : error Thor

**URL:** https://meta.discourse.org/t/restore-backup-error-thor/58170
**Category:** Support
**Created:** [March 1, 2017, 1:59pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170 "2017-03-01T13:59:25Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Chopper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chopper/32/57073_2.png) [@Chopper](https://meta.discourse.org/u/Chopper)
#### Post date: [March 1, 2017, 1:59pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/1 "2017-03-01T13:59:25Z")

</div>

I tried to restore a backup with command line (GUI is not an option) but I get this error :

```plaintext
root@forum:/var/discourse# ./launcher enter app
root@forum-app:/var/www/discourse# discourse restore
You must provide a filename to restore. Did you mean one of the following?

script/discourse restore tact-forum-2017-02-01-075306-v20161216101352.tar.gz
root@forum-app:/var/www/discourse# script/discourse restore tact-forum-2017-02-01-075306-v20161216101352.tar.gz
/usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- thor (LoadError)
	from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from script/discourse:3:in `<main>'

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 1, 2017, 2:07pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/2 "2017-03-01T14:07:35Z")

</div>

@zogstrip can you have a look?

---

<div class="post-metadata">

### Author: ![Chopper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chopper/32/57073_2.png) [@Chopper](https://meta.discourse.org/u/Chopper)
#### Post date: [March 1, 2017, 3:42pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/3 "2017-03-01T15:42:41Z")

</div>

> [@Chopper](#):
>
> usr/local/lib/ruby/2.3.0/rubygems/core\_ext/kernel\_require.rb:55:in `require’: cannot load such file – thor (LoadError)

Seems my docker is broken. Is there a way to quickly check if someting went wrong in the docker ?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 2, 2017, 12:37am UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/4 "2017-03-02T00:37:54Z")

</div>

The Thor gem isn’t installed by default.

From your container run `gem install thor` and you should be good to go.

---

<div class="post-metadata">

### Author: ![Chopper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chopper/32/57073_2.png) [@Chopper](https://meta.discourse.org/u/Chopper)
#### Post date: [March 2, 2017, 5:15pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/5 "2017-03-02T17:15:35Z")

</div>

Why the gem `thor` is not installed by default since he is used to do the backup ?

There is a GUI to restore a backup but an admin need to go on the docker to install the gem and then restore the backup ? 😒

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 2, 2017, 5:18pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/6 "2017-03-02T17:18:59Z")

</div>

I’ve actually wondered this for a while. If `thor` is needed for our CLI surely it should be installed in the Gemfile.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 2, 2017, 5:21pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/7 "2017-03-02T17:21:46Z")

</div>

It is in the lock

> <https://github.com/discourse/discourse/blob/main/Gemfile.lock#L362>

---

<div class="post-metadata">

### Author: ![Chopper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chopper/32/57073_2.png) [@Chopper](https://meta.discourse.org/u/Chopper)
#### Post date: [March 2, 2017, 5:24pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/8 "2017-03-02T17:24:22Z")

</div>

I have this file too, but obviously the gem are not installed

```plaintext
root@ubuntu-app:/var/www/discourse# gem list

***LOCAL GEMS***

bigdecimal (1.2.8)
bundler (1.14.5, 1.13.7)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.5)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.1.0)
rake (10.4.2)
rdoc (4.2.1)
test-unit (3.1.5)

```

**This is a fresh install, the lastest version of discourse downloaded this morning.**

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 2, 2017, 5:55pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/9 "2017-03-02T17:55:33Z")

</div>

Maybe it is only installed in dev mode, agree we should fix this, expecting people to install gems just to get `discourse` CLI to run is crazy

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 2, 2017, 6:36pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/10 "2017-03-02T18:36:34Z")

</div>

I think this will fix it:

[https://github.com/discourse/discourse/commit/890f1bde894239a86da49908a31aa5e0a33072f5](https://github.com/discourse/discourse/commit/890f1bde894239a86da49908a31aa5e0a33072f5)

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [March 2, 2017, 7:21pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/11 "2017-03-02T19:21:59Z")

</div>

Be careful, I remember that a thor version beyond 0.19.1 breaks stuff in ugly ways.

---

<div class="post-metadata">

### Author: ![Chopper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chopper/32/57073_2.png) [@Chopper](https://meta.discourse.org/u/Chopper)
#### Post date: [March 2, 2017, 7:40pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/12 "2017-03-02T19:40:36Z")

</div>

Or the gem should be installed when backup button is clicked and removed after regarding what @michaeld says

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 2, 2017, 8:06pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/13 "2017-03-02T20:06:36Z")

</div>

> [@michaeld](#):
>
> I remember that a thor version beyond 0.19.1 breaks stuff in ugly ways.

Really? Whenever I encountered the error I’d type `gem install thor` on the command line to get the latest version and it’s always worked. Do you have steps to reproduce it?

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [March 2, 2017, 9:29pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/14 "2017-03-02T21:29:23Z")

</div>

Sorry, can’t find it in my notes ☹

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/restore-backup-error-thor/58170/15 "2024-06-08T12:44:59Z")

</div>

This topic was automatically closed after 2655 days. New replies are no longer allowed.
