Installing Discourse on Centos/WHM

I’ve reinstalled ruby and all the gems. I cloned a clean copy of the files into the folder and still get the same error on: bundle exec rspec The rspec gems installed without error so the problem doesn’t appear to be there.

The complete error is below.

At this point I’ve exhausted all server side issues I can think of and have to believe there is an issue with the build files that is looking for fakeweb in some other location than where it is within the install. It doesn’t matter if we specify the file directly, it still looks in the wrong location and can’t find it.

/home/domain/public_html/support/spec/spec_helper.rb:12:in `require': cannot load such file -- fakeweb (LoadError)
    from /home/domain/public_html/support/spec/spec_helper.rb:12:in `<top (required)>'
    from /home/domain/public_html/support/spec/components/admin_user_index_query_spec.rb:1:in `require'
    from /home/domain/public_html/support/spec/components/admin_user_index_query_spec.rb:1:in `<top (required)>'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
    from /home/domain/public_html/support/vendor/bundle/ruby/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'

Please suggest.
Thank you

What’s the output of bundle install and bundle exec gem contents fakeweb?

Here is the output

[root@server1 /home/domain/public_html/support]# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Using rake 10.4.2
Using CFPropertyList 2.2.8
Using i18n 0.6.11
.
.
.
Using unicorn 4.8.3
Your bundle is complete!
Gems in the group test were not installed.
It was installed into ./vendor/bundle

Can’t finds dir.

 [root@server1 /home/domain/public_html/support]# bundle exec gem contents fakeweb
    Unable to find gem 'fakeweb' in default gem paths
    
    Directories searched:
    [root@server1 /home/domain/public_html/support]#

Ho boy, if you’re running Discourse as root, your setup is rather questionable. If this is a production server and you’re logged in as root for maintenance, you shouldn’t be running tests; if this is a dev machine, you shouldn’t be logged in as root…

What should it be? user : discourse ?

Only Docker installs are supported here. Please follow our official install guide.

Sure, I will give it try with Docker. But my questions are

  • Since I’m trying to install it on WHM which hosts some Wordpress sites too, Will it affect my other cpanels/Wordpress sites?
  • Is it safe to do the installation alongside wordpress ?

Docker isolates Discourse from everything else that is currently installed on your server, including databases and webservers. However, since the webserver currently running on your server will be listening on the HTTP and HTTPS ports, you will have to configure that server to reverse-proxy requests for your Discourse site to the other webserver running inside the Docker container.

3 Likes

You didn’t install the test gems, and you’re trying to run the tests.

Why are you trying to run the tests?

I suggest getting a Docker setup.

No, as long as you put nginx in front.

@riking Looks like your idea worked for me. Thank you so much.

@elberet Thank you for your kind support.