Discourse as Your First Rails App

Let me guess, Windows 10 ?

I installed my localhost Discourse around a year and a half ago. At that time I had Windows 7 Home Premium

I followed “Discourse as Your First Rails App” as best as I could.
Installed VirtualBox
Installed Vagrant
Installed GitHub
Downloaded Discourse

I can’t say everything has gone swimmingly since, but it worked well enough for getting familiar with Discourse and testing plugins

- UNTIL - I upgraded to Windows 10 this last weekend. Now I get

Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

C:\VirtualBox\discourse [master +0 ~1 -0]> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,int,int *)" at line 66 of file VBoxManageHostonly.cpp

C:\VirtualBox\discourse [master +0 ~1 -0]>

Not the exact same problem you’re having, but I am wondering if the ~2 1/2 year old instructions are still applicable or if I might need t upgrade

GitHub The Last Free Monad (3.0.6.4) 2bb6864
VirtualBox 4.3.30 r 10 16 10
vagrant 1.7.4

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?