Discourse as Your First Rails App

(Frank Piva) #121

I’m slightly confused by the setup guide for a development environment. I have already installed a production instance of Discourse and had very little issues understanding/executing the instructions.

On your development instructions it seems like you keep switching back in forth between Linux and Windows/Mac. I am trying to install a development environment on a dedicated, remote Linux server. Is this where I’m making a mistake? Are these instructions intended for a local install?


(Robin Ward) #122

If you are installing on a Linux server you can still use vagrant to get set up easily. However, you might prefer to follow this guide that explains how to set it up without virtualization.

(Frank Piva) #123

Thanks for providing the link to the guide, but unfortunately I also tried that to no avail. It seems the initial script he provides fails to install Ruby correctly. I’ll try to give it another shot though. It seems my issue is getting narrower.

(Frank Piva) #125

So I think I figured out my issue. I was trying to install Discourse on a dedicated AWS instance, that I was accessing through a Linux VM. I’m not sure where exactly the problem was, but when I tried installing directly to the VM itself and not the AWS instance it worked like a charm.

This is the guide I was using.

I followed these steps exactly on the AWS cloud instance (making sure I had the latest version of each dependency) and it failed. I did the exact same thing on my local VM and it succeeded. Like I said, I don’t know what the exact issue is, but I hope this helps someone else, and I look forward to hacking on Discourse.

(Osama) #126

Okay, so I’ve successfully installed Discourse locally on my computer, but there is one simple problem, seriously, how can I login? I solved a ton of problems and errors by myself while installing the application, but this one, I couldn’t!

My OS is Windows 10, if that helps.

And Ah, Sorry for bumping this thread, I didn’t want to create a new thread for just this little problem.

(Mittineague) #127

Have you tried going to this URL

Though IMHO it’s better to create a new Admin account using the CLI

(Osama) #128

Yep, that works. Thanks a lot @Mittineague :slight_smile:

(Stephen Rider) #130

It’s not too hard to figure out, but you might want to specify what the user needs to do the NEXT time they start this up. Obviously they don’t need to run all the install stuff again, but it seems they do need to re-run the server bit at the end?

Also: When I try to vagrant up the second time, I get an error when it tries to mount the NFS volume. The protocol is not loaded. (This is Mac OS 10.11.4)

Finally, what is the login for Discourse in the VM? I can’t get to the admin area because I don’t know this!

(Rafael dos Santos Silva) #133

Awnser is 2 topics above you :wink:.

(Andrew Byrne) #134

Hi I’m a developer that has been touched by Ruby on Rails… :expressionless:

I really like the development version of the system BUT am struggling to see where I can enable the CORS for the development instance?


(Andrew Byrne) #135

OK totally got ^^^^ that…

seems that editing discourse_defaults.conf

# enable Cross-origin Resource Sharing (CORS) directly at the application level
enable_cors = true
cors_origin = '*'

then restart

bundle exec rails s -b

does the trick, just not for prod please.

(Mudedla Panduranga Rao ) #136

Is there any way to use discourse without using VM? Does it can be used with local system as normal rails app?

(Felix Freiberger) #137

Docker is not a VM, it does not suffer the same performance penalty as virtualization.

The official Docker-based install is the only supported installation method (for production use). In theory, you can also use different installation methods, but it will be entirely unsupported, is likely slower than a Docker-based install, and can break with any upgrade.

(James Kiesel) #138

I’ve been able to develop on Discourse just fine using my local machines (mac and linux), no VM required. (Windows will be a bit trickier, so Vagrant or something similar would be the way to go there)

(Tobias Eigen) #139

Can you explain how to set this up or link to a howto?

(James Kiesel) #140

Here’s a back-of-the-napkin approximation for mac (linux will be the similar with apt-get instead of brew):

(this assumes that you’re using the correct ruby version [2.3.0 at the time of this writing], probably installed with either rvm or rbenv)

brew install redis
brew install postgres
git clone https://github.com/discourse/discourse.git && cd ./discourse
bundle install
rake db:setup
redis-server &
bundle exec rails s

(Mudedla Panduranga Rao ) #141

Thanks for your support. I successfully installed discourse in my local system and running from http://localhost:3000. But i got stuck when i’m trying to embed comments in other websites from my discourse. When i tried to embed comments i’m getting only Loading Discussion message in browser text, but if i passed topicId as parameter it is loading comments perfectly. Can some please help me to resolve this.


(Ganesh T) #142

That helped ! Will try it out


Thanks for the guide, I’ve got Discourse up and running locally in a VM.

However, unlike the blog screenshot, though, I’m seeing a ‘blank’ discourse forum in set-up mode with the usual ’ Congratulations, you installed Discourse!’ title - am I not meant to be seeing an ‘example’ forum with some pre-loaded threads like the screenshot?

Also, can I load in a back-up of my Production forum using command line fairly simply - any gotcha’s doing this?


(Joshua Rosenfeld) #144

That is expected - there’s no pre-seeded content in development installs. That screenshot was just an example of a site running locally, not a brand new development install.