Problem with discourse upgrade from AWS on t2.micro

docker

#1

I tried to upgrade to beta4 using the the admin console and got a memory allocation error:

***  Bundling assets. This might take a while *** 
$ bundle exec rake assets:precompile
Purging temp files
rake aborted!
Errno::ENOMEM: Cannot allocate memory - rm
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/lib/tasks/assets.rake:12:in `block in '
Tasks: TOP => assets:precompile => assets:precompile:before
(See full trace by running task with --trace)

Can I fix this by upgrading from an ssh terminal session?


(Jeff Atwood) #2

As stated in many places including the install guide, 1gb ram is the minimum to run Discourse. You will also need a swap file just in case, even with 1gb.


#3

Understood. I’m still just getting familiar with the site - and with dockers/ruby/etc. This is not production so I can shut down the site to perform the upgrade.

I suppose my question should really be,

Q: how do I upgrade discourse from the command line?


(Jens Maier) #4

If you’re using the supported install method: /var/discourse/launcher rebuild

If you’ve installed manually and yet don’t know how to upgrade, make a backup, reinstall with the supported method and restore the backup. :wink:

git pull
bundle install
bundle exec rake assets:precompile
kill -QUIT `cat tmp/pids/unicorn.pid`
bundle exec rake db:migrate
bundle exec unicorn -D -c config/unicorn.conf.rb
bundle exec rake assets:clean

#5

Thanks. That was exactly what I needed.

BTW for others who are checking out Discourse: I started with the AWS Bitnami image to get discourse running quickly, but it did NOT follow the recommended dockers install and it was impossible to figure out how to do things like add a plugin. So I started again with just a plain Ubuntu 14.04 HVM image and followed the recommended dockers install. It was not too much more work, but the ability to get support through the forum is worth it.