Beginners Guide to Install Discourse on Ubuntu for Development


(Matt Dugan) #134

Just curious… why does discourse need phantom.js?


(Rafael dos Santos Silva) #135

Probably for tests. Front end qunit tests


(Sam Saffron) #136

I just fixed the error so it is less crazy bananas.

It is happening because it is having trouble connecting to redis.

I am not sure exactly how you have stuff setup but…

  1. Make sure you are running redis 2.8 or up.
  2. Make sure that you can connect to redis via Ruby.
irb
> require 'redis'
> Redis.new().get('x')

(Sara Rey Chipps) #137

Redis.new().get(‘x’) returns nil, I assume this is Ruby not being able to connect. Will dig deeper.


(Sam Saffron) #138

Is that inside the vagrant VM or on the host? How is stuff setup?


(Sara Rey Chipps) #139

Inside Vagrant VM. I am following this tutorial.


(Sam Saffron) #140

The huge issue we have with Vagrant at the moment is that nobody in the core team uses it, so what happens is that over time the template just gets old, crusty and broken.

This has happened so many times now that my call would be to totally remove all references to it unless someone steps up and actively maintains it.

My strong recommendation would be:

  1. If you are on Windows, run your own VM for Discourse dev

  2. If you are on Mac, get a rails environment up (install pg,redis,rbenv or chruby)

The vagrant issue is most likely happening because it is running an old version of redis, my fix (a couple of posts up) should resolve the issue.


(Dave McClure) #141

I support this… and since the core team is not really supporting it, if someone wants to actively maintain it they should really do so in a separate repo, IMHO.


(Sara Rey Chipps) #142

This makes sense, is there an OSX install guide (or, not Ubuntu, which is the only one I see)? Thanks!


(Arpit Jalan) #143

Is this the guide you are looking for:

Feel free to PM me if you face any difficulty while following the steps. I’ll be updating both Ubuntu and Mac OS X guides shortly, so first-hand feedback is appreciated. :slight_smile:


(Sara Rey Chipps) #144

This worked great. A few tests failed after the seeds were loaded. Didn’t break when I ran it, however. I may need to pull the latest. Thanks!


(Arpit Jalan) #146

I updated the OP (and install script) as per comments and feedback, and followed this guide on my fresh Ubuntu installation to setup Discourse dev environment, verified that everything is good! (outdated/irrelevant posts have been deleted)


#147

This is my referral topic for those Linux savvy folks out there. Flawless install. Thanks @techAPJ!

I honestly tried the Discourse as the first rails app tut, then the tut on vagrant install. I REALLY dislike Windows, and was uber confused on switching between OS’s on VM and default. That guide could prolly use some updating, IMHO. Vagrant on Ubuntu? The Vagrantfile is outdated, and not maintained, I think, so even though nice, it needs some love.

Best way to install? Yep, right here. I did a VirtualBox, matched it’s specs to the VPS my production version is on, and now I can finally tinker with the silly “who’s online” thingy my members have been requesting.


(cpradio) #148

Uh… it was just updated by @tarek… So vagrant does indeed work pretty well now.


(Mufid) #149

Is there anything i should do? I upgraded from previous version of vagrant image (14.04 -> 16.04), but i got this. I searched the error message on Google, some said the image is broken (Chef issue).

$ vagrant destroy && vagrant up
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'discourse-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: discourse_default_1468456219506_9027
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 3000 (guest) => 4000 (host) (adapter 1)
    default: 1080 (guest) => 4080 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get -y update

Stdout from the command:

Reading package lists...


Stderr from the command:

mesg: ttyname failed: Inappropriate ioctl for device
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

(OG) #150

I’ve just found out that when you need to make development webserver available not only from localhost, but remotely, you need to start it with:

bundle exec rails server --binding=0.0.0.0

Installation on fresh Ubuntu 14.04.4 LTS according to this guide was flawless, although I’ve got quite few failed rspec tests (31).


(Jay Pfaffman) #151

I followed these directions and have built a working development system, it seems. (I added a suggestion to fork Discourse before cloning, and wish there were an easy and obvious way to automate editing all those references to techapj, but I digress. . .)

BUT, what I want to do is some tweaks to the links to github, and http://localhost:3000/admin/upgrade returns "No route matches [GET] “/admin/upgrade”

What do I need to do to be able to hack on that?


(Rafael dos Santos Silva) #152

That’s probably on the docker plugin, that gets bundled by default on the docker installer.


(Jay Pfaffman) #153

Thanks @Falco! (It’s obvious now. . .)

So

cd plugins
git clone https://github.com/discourse/docker_manager.git # or your fork 

and, docker_manager requires pngcrush, so if you want to hack on docker_manager, you’ll also need to

sudo apt-get install pngcrush

(Probably obvious to anyone who gets that far, but here it is anyway. . . )


(Jay Pfaffman) #154

If only it were that simple. Apparently getting node.js, bower, grunt is not as simple as one might hope. I’m guessing that there are version issues, but I don’t have much helpful to add, as I’ve been banging on this for several hours now and it’s all a blur.

I’m running Ubuntu 16.04. I can’t quite tell when to use apt and when to use over various means of installing the various pieces.

This time through the gauntlet, it’s complaining about loader.js

Here’s the error I’m getting at this point:

 ember server --proxy "http://localhost:3000"
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `ember-cli-htmlbars`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `Ember CLI QUnit`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
DEPRECATION: Brocfile.js has been deprecated in favor of ember-cli-build.js. Please see the transition guide: https://github.com/ember-cli/ember-cli/blob/master/TRANSITION.md#user-content-brocfile-transition.
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `ember-cli-htmlbars`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `Ember CLI QUnit`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
The loader.js addon is missing from your project, please add it to `package.json`.

here’s some version info:

pfaffman@balloon:~/discourse/plugins/docker_manager/manager-client$ npm -v
3.3.6
pfaffman@balloon:~/discourse/plugins/docker_manager/manager-client$ bower -v
1.7.9
pfaffman@balloon:~/discourse/plugins/docker_manager/manager-client$ ember -v
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `ember-cli-htmlbars`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
DEPRECATION: Overriding init without calling this._super is deprecated. Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `Ember CLI QUnit`
    at Function.Addon.lookup (/home/pfaffman/discourse/plugins/docker_manager/manager-client/node_modules/ember-cli/lib/models/addon.js:896:27)
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
ember-cli: 2.6.3
node: 5.0.0
os: linux x64