Discourse as Your First Rails App

Well, I’ve made some progress

I went back to
https://www.virtualbox.org/ticket/14040
I hadn’t read far before, and saw that VirtualBox 5 was supposedly free of this problem - BUT - when I tried it learned that version 5 is not supported by the latestest version of GitHub

Just now I read more and found
https://www.virtualbox.org/attachment/ticket/14040/VBox-Win10-fix-14040.exe

It now gets past the error but times out trying to connect.
Aaarrrgggh! #@*$!#@

1 Like

@Thrillberg I got the same error as you. Did you got a way to fix yet?

Hmm, nope I’m on Mac OSX 10.10. :frowning:

@Thrillberg @ptgamr

Maybe these will help

https://meta.discourse.org/t/upgrade-failed-after-the-recent-todays-commits-cannot-load-such-file-rails-multisite/34396?u=mittineague

Thanks for these links! Unfortunately, it doesn’t work for me. gem rails_multisite was already in my Gemfile and when I tried the sudo chmod a+r generators.rake command, it gave me this error:
chmod: cannot accessgenerators.rake’: No such file or directory`

I had this error recently. Turned out to be permissions related. The fix is available here https://meta.discourse.org/t/rails-multisite-still-breaking-build/34575/14?u=matthew_asbury

2 Likes

Awesome! Worked for me. Thanks so much!

Don’t know if this has been posted yet. But I had trouble accessing from the browser in my Windows. I used rails s -b 0.0.0.0 to access the site.

4 Likes

this should truly be part of the tutorial now since rails doesn’t bind to 0.0.0.0 by default as of 4.2

I’m unable to post the SO link here because I am new but if you google search ‘What does binding a Rails Server to 0.0.0.0 buy you?’ there’s some chatter on it

2 Likes

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?

Thanks.

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.

2 Likes

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.

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.

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.

Have you tried going to this URL
http://localhost:4000/session/eviltrout/become

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

https://meta.discourse.org/t/how-to-create-an-administrator-account-after-install/14046?u=mittineague

5 Likes

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

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!

Awnser is 2 topics above you :wink:.

2 Likes

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?

Anyone?

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 0.0.0.0

does the trick, just not for prod please.

1 Like