Beginners Guide to Install Discourse on Ubuntu for Development

dev-install

(Daniel Hollas) #227

Awesome guide, worked like a charm! :heart:

…except, don’t you need an extra step to install nodejs dependencies? Specifically, to run JS tests using qunit, I had to run:

npm install

(Arpit Jalan) #228

I updated the linux install script to install Node.js and svgo library. PR welcome for further improvements. :slight_smile:


(MorphZan) #229

Good Day

I have installed a fresh Ubuntu Server 18.04
I have run all the updates, rebooted.

Ran the command:

bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)

It gets to this portion and it just sits here doing nothing - is there anything I can do from here or is it stuck permanently…

18


(Arpit Jalan) #230

Installing ruby takes time … maybe wait for ~20 mins.


(MorphZan) #231

Patience !!! Something im learning!!! :laughing:


(MorphZan) #232

After running this command:

bundle exec rake autospec

I am now stuck as follows, I am patiently waiting as suggested before but should I be concerned with the failures?:


(Arpit Jalan) #233

I need to look into why those tests are failing. In the meantime you can abort the rspec command and start using your local Discourse instance for development. If you reached to that step, your setup should be fine.


(Gerhard Schlager) #234

You need to install Imagemagick 7.


(MorphZan) #235

Going to continue then from here


(MorphZan) #236

Thank you for this have done so as well


(Jay) #237

I am trying to install on a fresh copy of Ubuntu downloaded from the Windows store.
I can’t get past this command:
bundle exec rake db:create db:migrate
I get the following error:

bundle exec rake db:create db:migrate
/home/jay.treptow/discourse/Rakefile
Failed to report error: Invalid argument 2 Invalid argument subscribe failed, reconnecting in 1 second. Call stack ["/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/connection/hiredis.rb:19:in `connect'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/connection/hiredis.rb:19:in `connect'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:334:in `establish_connection'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:99:in `block in connect'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:291:in `with_reconnect'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:98:in `connect'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:274:in `with_socket_timeout'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:131:in `call_loop'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/subscribe.rb:43:in `subscription'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/subscribe.rb:12:in `subscribe'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:2824:in `_subscription'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:2192:in `block in subscribe'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:45:in `block in synchronize'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:45:in `synchronize'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:2191:in `subscribe'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/message_bus-2.1.5/lib/message_bus/backends/redis.rb:337:in `global_subscribe'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/message_bus-2.1.5/lib/message_bus.rb:530:in `global_subscribe_thread'", "/home/jay.treptow/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/message_bus-2.1.5/lib/message_bus.rb:478:in `block in new_subscriber_thread'"]
rake aborted!
Errno::EINVAL: Invalid argument
/home/jay.treptow/discourse/lib/discourse_redis.rb:200:in `block in del'
/home/jay.treptow/discourse/lib/discourse_redis.rb:153:in `ignore_readonly'
/home/jay.treptow/discourse/lib/discourse_redis.rb:198:in `del'
/home/jay.treptow/discourse/lib/cache.rb:57:in `delete_entry'
/home/jay.treptow/discourse/lib/site_setting_extension.rb:366:in `clear_cache!'
/home/jay.treptow/discourse/lib/site_setting_extension.rb:262:in `block in refresh!'
/home/jay.treptow/discourse/lib/site_setting_extension.rb:243:in `synchronize'
/home/jay.treptow/discourse/lib/site_setting_extension.rb:243:in `refresh!'
/home/jay.treptow/discourse/lib/site_setting_extension.rb:408:in `block in setup_methods'
/home/jay.treptow/discourse/config/initializers/004-message_bus.rb:99:in `<main>'
/home/jay.treptow/discourse/config/environment.rb:5:in `<main>'
/home/jay.treptow/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
/home/jay.treptow/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
(See full trace by running task with --trace)

It doesn’t appear as though the database is getting created. I created the two databases manually discourse_development and discourse_test

                                     List of databases
         Name          |    Owner    | Encoding | Collate |  Ctype  |   Access privileges
-----------------------+-------------+----------+---------+---------+-----------------------
 discourse_development | jay.treptow | UTF8     | C.UTF-8 | C.UTF-8 |
 discourse_test        | jay.treptow | UTF8     | C.UTF-8 | C.UTF-8 |
 postgres              | postgres    | UTF8     | C.UTF-8 | C.UTF-8 |
 template0             | postgres    | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                       |             |          |         |         | postgres=CTc/postgres
 template1             | postgres    | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                       |             |          |         |         | postgres=CTc/postgres

does anybody have a clue as to what I am missing?


(Arpit Jalan) #238

I think you might want to follow this guide:


(Jay) #239

Yes I am starting from this post, which uses this post as the setup. The error I get when I run
bundle exec rake db:create db:migrate
Is saying there is an invalid parameter but I really think that the problem is that it does not connect to the redis server even though is is running and bound.

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   8304   108 ?        Ss   11:05   0:00 /init ro
root         3  0.0  0.0   8304    80 tty1     Ss   11:05   0:00 /init ro
jay.tre+     4  0.0  0.0  16908  3036 tty1     S    11:05   0:00 -bash
postgres   150  4.7  0.1 220752 19464 ?        S    12:50   0:01 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
postgres   152  0.0  0.0 220752  1372 ?        Ss   12:50   0:00 postgres: 10/main: checkpointer process
postgres   153  0.0  0.0 220752  1784 ?        Ss   12:50   0:00 postgres: 10/main: writer process
postgres   154  0.0  0.0 220752  5580 ?        Ss   12:50   0:00 postgres: 10/main: wal writer process
postgres   155  0.0  0.0 221160  2160 ?        Ss   12:50   0:00 postgres: 10/main: autovacuum launcher process
postgres   156  0.0  0.0  75676  1268 ?        Ss   12:50   0:00 postgres: 10/main: stats collector process
postgres   157  0.0  0.0 221044  1904 ?        Ss   12:50   0:00 postgres: 10/main: bgworker: logical replication launcher
jay.tre+   171  0.0  0.0  49580  2028 ?        Ssl  12:50   0:00 redis-server *:6379
jay.tre+   175  0.0  0.0  17380  1916 tty1     R    12:50   0:00 ps aux

(Jay Pfaffman) #240

I agree that it looks like a redis connection error.


(Jay) #241

I figured out what the problem was. Our corp machines have Sophos Endpoint installed. I was blocking the redis port.


(Jais Gossman) #242

Coming at this as a complete newbie. Everything went swimmingly until I put in the command: bundle install.

An error occurred while installing libv8 (6.7.288.46.1), and Bundler cannot
continue.
Make sure that gem install libv8 -v '6.7.288.46.1' --source 'https://rubygems.org/'
succeeds before bundling.

In Gemfile:
mini_racer was resolved to 0.2.3, which depends on
libv8

in red:
Could not find libv8-6.7.288.46.1 in any of the sources

What am I to do?


(Rafael dos Santos Silva) #243

Did you try running gem install libv8 -v '6.7.288.46.1' --source 'https://rubygems.org/' like said? What was the output?


(Jais Gossman) #244

[1:05:22] Still working on:
[1:05:22] v8/third_party/icu
[1:05:32] Still working on:
[1:05:32] v8/third_party/icu
[1:05:42] Still working on:
[1:05:42] v8/third_party/icu
[1:05:52] Still working on:
[1:05:52] v8/third_party/icu
[1:06:02] Still working on:
[1:06:02] v8/third_party/icu
[1:06:12] Still working on:
[1:06:12] v8/third_party/icu
[1:06:22] Still working on:
[1:06:22] v8/third_party/icu
[1:06:32] Still working on:
[1:06:32] v8/third_party/icu
[1:06:42] Still working on:

this is what goes on for quite some minutes. Not sure how to contextualize this, but here is a random snippet also.

side note: it’s a lot of output. how can I show text in separate box, like others who show their ongoing work?


(Jais Gossman) #245

Hook ‘/usr/bin/python v8/tools/clang/scripts/update.py’ took 210.67 secs

WARNING: ‘v8/third_party/depot_tools’ is no longer part of this client. It is recommended that you manually remove it.

WARNING: ‘v8/test/wasm-js/data’ is no longer part of this client. It is recommended that you manually remove it.

Beginning compilation. This will take some time.
Traceback (most recent call last):

Oops, here’s the random snippet


(Jais Gossman) #246

and finally:

extconf failed, exit code 1

so, I’m not sure if I’m defining the problem clearly, only know that the bundle command is where I was hung up.