# How to edit the discourse files? A development box?

**URL:** https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388
**Category:** Self-hosting
**Created:** [February 24, 2018, 8:20am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388 "2018-02-24T08:20:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [February 24, 2018, 8:20am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/1 "2018-02-24T08:20:16Z")

</div>

I would like to play with the files in discourse - Im not a coder, but I have some tweeks I would like to see if Im able to add. The best way to learn is when you have something you will achieve 🙂

I have a little knowledge from php. There you can change a file and see the result of the changes immedealy.

In my discourse server Im not able to finde the .rb files I would like to find. Is that because I need a dev box?

This ruby universe seems to have a steep learning curve… :S

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [February 24, 2018, 8:44am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/2 "2018-02-24T08:44:39Z")

</div>

Best place to start is here

> [@Learn how to start building stuff for Discourse if you're newbie (like myself)](https://meta.discourse.org/t/how-to-start-building-stuff-for-discourse-if-youre-newbie-like-myself/45954):
>
> There are a few ‘how to start’ guides for working with Discourse already and a wealth of useful info on meta, but I thought it might help to give an insight to the mental processes of starting from little, if any, prior coding experience to building substantial Discourse plugins. Discourse is written by experienced developers and has a large codebase. This can feel intimidating. This intimidation factor can be a significant barrier for novice developers. This is a kind of ‘psychological primer’…

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [February 24, 2018, 9:18am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/3 "2018-02-24T09:18:36Z")

</div>

I will look at it, thanks 🙂

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [February 25, 2018, 11:39am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/4 "2018-02-25T11:39:25Z")

</div>

But it is still not clear to me: Can I on a live setup/site - browse the .rp files via my SSH connection - edit them and see if my changes work?

If I in shell do

`cd /var/discourse`

Then:  
`./launcher rebuild app`

Then  
`ls -ls`

I get this - where do I find the files?

 ![58](https://global.discourse-cdn.com/meta/original/3X/7/7/77d370ebc8e91b97ebcf157dc97d65906f1fa72b.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 25, 2018, 3:00pm UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/5 "2018-02-25T15:00:24Z")

</div>

You need to set up a development environment to edit files and see changes. In production, lots of stuff is cached, so changes don’t show up.

If you want to see the files

```plaintext
cd /var/discourse 
. /launcher enter app 
cd src
ls

```

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [March 1, 2018, 8:32am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/6 "2018-03-01T08:32:07Z")

</div>

I was now able to follow this guide:

> [@Install Discourse on macOS for development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-mac-os-x-macos-for-development/15772/1):
>
> warning This guide covers installation instructions for a macOS development environment, for production guides see: [Install Discourse in production with the official supported instructions](https://meta.discourse.org/t/how-to-install-discourse-in-production/142537) So you want to set up Discourse on macOS to hack on and develop with? We’ll assume that you don’t have Ruby/Rails/Postgres/Redis installed on your Mac. Let’s begin rocket ! Install Discourse Dependencies You will need the following packages on your system: [Git](http://git-scm.com/)[rbenv](https://github.com/sstephenson/rbenv) or [asdf](https://asdf-vm.com/guide/getting-started.html)[ruby-build](https://github.com/sstephenson/ruby-build)[Ruby](https://www.ruby-lang.org/) (latest s…

I would like to edit and see if I was able to add some changes to: `https://github.com/discourse/onebox/blob/master/lib/onebox/engine/amazon_onebox.rb`

But Im not able to find the file on my mac?

 ![07](https://global.discourse-cdn.com/meta/original/3X/9/f/9f0e10ebd266697942978d0cc9b42866f7888e86.png)

Damn it have a steep learning curve this thing…

Wish me back to the old apache days… 🤔

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [March 1, 2018, 8:34am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/7 "2018-03-01T08:34:12Z")

</div>

> [@frold](#):
>
> [GitHub - discourse/onebox: (DEPRECATED) A gem for turning URLs into website previews · GitHub](http://github.com/discourse/onebox)

To edit onebox files, you need to clone source code for onebox gem.

[https://github.com/discourse/onebox](https://github.com/discourse/onebox)

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [March 1, 2018, 8:37am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/8 "2018-03-01T08:37:32Z")

</div>

Didnt I do so in this step in the tutorial?

> git clone [GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub](https://github.com/discourse/discourse.git) ~/discourse

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [March 1, 2018, 8:39am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/9 "2018-03-01T08:39:11Z")

</div>

That was for cloning discourse _core_ repo. If you want to hack on onebox gem, you will need to clone the source code for that gem as well.

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [March 1, 2018, 8:43am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/10 "2018-03-01T08:43:18Z")

</div>

Okay, then I dont know anything…

What is the difference of a dev box and a running site then?

I thought setting up a dev box I would be able to edit files…

Seems now I need to follow another tutorial…?

This is only for very technical users, like in very - 😊 I give up

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [March 1, 2018, 9:09am UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/11 "2018-03-01T09:09:11Z")

</div>

You have the core files and then you have various modules that discourse rely on - some developed by discourse and some not. Onebox is one of those modules.

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [March 1, 2018, 1:01pm UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/12 "2018-03-01T13:01:12Z")

</div>

ahh, now I understand.

But what I need to edit is the file that renders the amazon data like this:

> **[Robbins Basic Pathology (Robbins Pathology): 9780323353175: Medicine & Health...](https://www.amazon.com/Robbins-Basic-Pathology/dp/0323353177)**
>
> Robbins Basic Pathology (Robbins Pathology): 9780323353175: Medicine & Health Science Books @ Amazon.com

Its give me the same output at my dev box on my mac. I thought it was the file mention above…

What files is it then… :S

---

<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:37pm UTC](https://meta.discourse.org/t/how-to-edit-the-discourse-files-a-development-box/81388/13 "2024-06-08T12:37:44Z")

</div>

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