Trying to install discourse on Centos

Has anyone succeeded on installing Discourse (www.discourse.org) on Centos with Apache running Phusion Passenger? I’ve got so far but ended up with an error that seems to indicate my GEM_PATH environment variable not being properly set and not sure how to set that for Phusion Passenger.

I’ve asked this question on numerous forums including meta.discourse.org but no one seems to have a clue even though the procedure is supposedly covered in their documentation. However they seem to assume you’re a rails guru to begin with and thats one of the frameworks I haven’t used in years.

So anyway I decided to try here. If there is anyone who wants to give this a shot I have a link to my bash install scripts which I can ferret out. The install scripts I wrote myself and take the install procedure of installing all the requirements (dependencies) on Centos 6.5 from a clean install. I have done my best to make the installation “repeatable” in that the scripts check to see if a dependency is already installed (at least in most cases.)

Would anyone like to help me look into this?

Hope you don’t mind me piggy-back’ing on your thread. I recently tried to install discourse on Windows7 and also only got so far, and also had GEM_PATH errors on several repeated attempts

I followed this

and then this

but no joy :frowning:

You might as well come along for the ride and we’ll see how much mileage we get :wink: Just out of curiosity did you use phusion passenger or did you run it straight from Apache? Someone suggested that it might be phusion passenger that might be giving me problems and to try running it without it but didn’t elaborate. That was a reply on a rails forum (not the discourse forum).

My install scripts can be downloaded here: http://www.mediafire.com/download/dx3t84dtkegkrhc/install%20scripts.zip
It is a zipped self-contained folder of files I use to try and install discourse on a clean install Centos 6.5.

To run the scripts I type in root shell:

$ ./printec_basic_setup.sh
$ ./discourse-install.sh

Some of the scripts call other scripts but they are also in the zip folder.

When I try to go to the web page I get this error:

It looks like Bundler could not find a gem. This is probably because your
application is being run under a different environment than it’s supposed to.
Please check the following:

  • Is this app supposed to be run as the discourse user?
  • Is this app being run on the correct Ruby interpreter? Below you will
    see which Ruby interpreter Phusion Passenger attempted to use.
  • Are you using RVM? Please check whether the correct gemset is being used.
  • If all of the above fails, try resetting your RVM gemsets:
    https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets

-------- The exception is as follows: -------
Could not find rake-10.1.1 in any of the sources (Bundler::GemNotFound)
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/spec_set.rb:92:in materialize' /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/spec_set.rb:85:in map!’
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/spec_set.rb:85:in materialize' /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/definition.rb:133:in specs’
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/definition.rb:178:in specs_for' /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/definition.rb:167:in requested_specs’
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/environment.rb:18:in requested_specs' /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/runtime.rb:13:in setup’
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler.rb:119:in setup' /usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.5.2/lib/bundler/setup.rb:17 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' /opt/passenger/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:219:in run_load_path_setup_code’
/opt/passenger/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:333:in running_bundler' /opt/passenger/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:217:in run_load_path_setup_code’
/opt/passenger/passenger-4.0.29/helper-scripts/rack-preloader.rb:96:in `preload_app’
/opt/passenger/passenger-4.0.29/helper-scripts/rack-preloader.rb:153
Application root
/home/discourse/discourse
Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV and PASSENGER_ENV)
production
Ruby interpreter command
/usr/bin/ruby
User and groups
uid=501(discourse) gid=502(discourse) groups=502(discourse),501(rvm) context=unconfined_u:system_r:httpd_t:s0
Environment variables
rvm_bin_path = /usr/local/rvm/bin
HOSTNAME = localhost.localdomain
GEM_HOME = /home/discourse/discourse/vendor/bundle/ruby/1.8
SHELL = /bin/bash
TERM = xterm
HISTSIZE = 1000
IRBRC = /usr/local/rvm/rubies/ruby-2.0.0-p353/.irbrc
QTDIR = /usr/lib64/qt-3.3
PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXnxxiJm
MY_RUBY_HOME = /usr/local/rvm/rubies/ruby-2.0.0-p353
QTINC = /usr/lib64/qt-3.3/include
USER = discourse
_system_type = Linux
rvm_path = /usr/local/rvm
rvm_prefix = /usr/local
MAIL = /var/spool/mail/discourse
PATH = /usr/local/rvm/gems/ruby-2.0.0-p353/bin:/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:/usr/lib64/qt-3.3/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/rvm/bin:/home/discourse/bin
PWD = /home/discourse/discourse
KDE_IS_PRELINKED = 1
LANG = C
KDEDIRS = /usr
_system_arch = x86_64
_system_version = 6
SSH_ASKPASS = /usr/libexec/openssh/gnome-ssh-askpass
HISTCONTROL = ignoredups
rvm_version = 1.25.15 (stable)
HOME = /home/discourse
SHLVL = 2
LOGNAME = discourse
QTLIB = /usr/lib64/qt-3.3/lib
CVS_RSH = ssh
GEM_PATH =
LESSOPEN = |/usr/bin/lesspipe.sh %s
_system_name = CentOS
G_BROKEN_FILENAMES = 1
IN_PASSENGER = 1
PYTHONUNBUFFERED = 1
NODE_PATH = /opt/passenger/passenger-4.0.29/node_lib
RAILS_ENV = production
RACK_ENV = production
WSGI_ENV = production
NODE_ENV = production
PASSENGER_APP_ENV = production
SERVER_PROTOCOL = HTTP/1.1
SERVER_SOFTWARE = Apache/2.2.15 (CentOS)
DOCUMENT_ROOT = /home/discourse/discourse/public
SERVER_ADMIN = root@localhost
QUERY_STRING =
SERVER_NAME = 192.168.1.65
REMOTE_PORT = 46467
REMOTE_ADDR = 192.168.1.65
SERVER_PORT = 80
REQUEST_METHOD = GET
SERVER_ADDR = 192.168.1.65
REQUEST_URI = /
_ORIGINAL_GEM_PATH = /usr/local/rvm/gems/ruby-2.0.0-p353:/usr/local/rvm/gems/ruby-2.0.0-p353@global

I followed http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/

Having Windows, I needed a VM so I installed https://www.virtualbox.org/
VirtualBox - VirtualBox-4.3.6-91406-Win.exe

then I installed http://www.vagrantup.com/
Vagrant - Vagrant_1.4.3.msi

I already had GitHub installed from before

then I created as repository cloned Discourse to it, opened a shell and ran
vagrant up
... a bunch ...
vagrant ssh

cd’d to the vagrant directory and ran
bundle install

That’s when I saw the “bundler” errors not finding GEM_PATH

I installed Ruby to C:\ because I wanted to be able to run it from command and edited the PATH
Ruby - rubyinstaller-1.9.3-p484.exe

Vagrant installed (default) to C:\HashiCorp\
Looking at
C:\HashiCorp\Vagrant\embedded\gems\bin\vagrant
I see

.....
# Useful variables
EMBEDDED_DIR="${DIR}/../embedded"

# Export gem paths so that we use the isolated gems.
export GEM_PATH="${EMBEDDED_DIR}/gems"
export GEM_HOME="${GEM_PATH}"
export GEMRC="${EMBEDDED_DIR}/etc/gemrc"
.....
# Set the path to the Ruby executable
RUBY_EXECUTABLE="${EMBEDDED_DIR}/bin/ruby"

I’m thinking my mistake was where I installed Ruby to but I haven’t messed around with it more yet.

Im surprised you having issues if you using vagrant as thats supposed to clone their development environment exactly as a VM. At least thats how I understand vagrant from reading the literature but haven’t used it myself.

So have sitepoint members voted by their non posting here? Is the concensus that discourse is impossible to install unless you’re an insider?

I finally buckled down with resolve to get this working.

I know I:
deleted the github local repository and used clone again
reinstalled vagrant but this time to c:\vagrant instead of the default
*Discourse looks for c:\vagrant instead of c:\hashicorp\vagrant ??

Plus I did so many other things I don’t remember them all or in what order I tried things

But, finally success

Ok, interesting, I may try the Docker install when I get a chance, probably less bloated than vagrant, but interesting that works as an install option.