Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Problems Installing Discourse on Centos 6.5 (Clean Install)

discourse

  • Please log in to reply
2 replies to this topic

#1 printec

printec

    Passenger

  • Members
  • 3 posts

Posted 21 January 2014 - 02:16 AM

I have been trying to install discourse (forum written in rails at www.discourse.org) with Apache and Phusion Passenger.  Its been many years since I've dabbled in rails and with all the new stuff I'm quite lost. (It's quite possible I'm doing something dumb.) Anyway I get as far as 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

To install I type in root shell:

 

$ ./printec_basic_setup.sh

$ ./discourse-install.sh

 

Phusion passenger and postgres.sh seem to install ok.  I don't know why GEM_PATH is not being passed.  My Apache conf file is as follows:

<VirtualHost *:80>
      ServerName localhost

      DocumentRoot /home/discourse/discourse/public

#      <IfModule !passenger_module>
#          <Directory /home/discourse/discourse/public>
#            AllowOverride all
#            Options -MultiViews
#            Require all granted
#          </Directory>
#      </IfModule>

        <IfModule passenger_module>
            Alias $subURI /home/discourse/discourse/public
            <Location $subURI>
                PassengerBaseURI $subURI
                PassengerAppRoot /home/discourse/discourse
            </Location>
            <Directory /home/discourse/discourse/public>
                Allow from all
                Options -MultiViews
                Satisfy Any
                SetEnv GEM_PATH  "/usr/local/rvm/gems/ruby-2.0.0-p353:/usr/local/rvm/gems/ruby-2.0.0-p353@global"
            </Directory>
        </IfModule>

      # Custom log file locations
      ErrorLog  /home/discourse/apache_logs/error.log
      CustomLog /home/discourse/apache_logs/access.log combined
    </VirtualHost>

See the "SetEnv GEM_PATH" which doesn't appear to be working.

 

I have uploaded all my install scripts (my progress so far to mediafire.com as it was too large of a zip file (12.76Mb) to upload here.)

 

The link url is https://www.mediafir...dx3t84dtkegkrhc

 

Would be great if someone from here could help me.

 

Thanks in advance

 

Glenn @ Printec

 



#2 stevieing

stevieing

    Dispatcher

  • Members
  • 40 posts

Posted 22 January 2014 - 11:11 AM

I have had this problem and passenger will look for gems in the same place it has been installed. There are ways around this but it may be better to get it up and running before you tackle that.

 

I guess you have installed passenger in /usr/local/rvm/gems/ruby-2.0.0-p353/ but you have done a bundle install in the gemset /usr/local/rvm/gems/ruby-2.0.0-p353@global.

 

In which case install passenger in the global gemset.

 

Also have you checked that the discourse is working without passenger beforehand. It can be very difficult to debug an application via passenger so I would start discourse from the command line.

 

Hope that helps

 

Steve.

 

Steve.



#3 printec

printec

    Passenger

  • Members
  • 3 posts

Posted 28 January 2014 - 12:12 AM

Ok, I tried running this as:

 

$ rails server

 

so I'm not running through Phusion or Apache but now I get this error when I browse to it:

ActiveRecord::StatementInvalid in ListController#latest
PG::Error: ERROR: relation "groups" does not exist LINE 5: WHERE a.attrelid = '"groups"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"groups"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum

Extracted source (around line #29):
27
28
29
30
31
32
          

  def group_names
    @group_name ||= Group.pluck(:name)
  end

  def categories

Rails.root: /home/discourse/discourse

Application Trace | Framework Trace | Full Trace
app/models/site.rb:29:in `group_names'
app/models/site.rb:68:in `cached_json'
app/controllers/application_controller.rb:200:in `preload_anonymous_data'
app/controllers/application_controller.rb:118:in `preload_json'
config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/silence_logger.rb:19:in `call'
lib/middleware/missing_avatars.rb:21:in `call'
lib/middleware/turbo_dev.rb:32:in `call'

I have no idea what's happening.  I followed the install instructions very pedantically.  Any ideas?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users