Custom avatars not showing up in preferences

(node) #1

I’ve set up custom avatars to be stored in S3, however even before this setting was enabled avatars do not appear in preferences despite being visible in the top right of the page.

(Brad Huber) #2

Do you have imagemagick and the rmagick gem installed? I was having this issue as well, and it was because in different places it expects different sized versions created by imagemagick.

(node) #3

Thanks, I didn’t have those installed. I’ve installed imagemagick successfully but can’t seem to install rmagick. I keep getting this error:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from extconf.rb:1:in `<main>'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out```

Any idea what i'm doing wrong?

I've searched online and have found I need to use ```sudo apt-get install libmagickwand-dev``` however I have already installed this package.

(Brad Huber) #4

Those are my least favorite errors to get when installing gems because if installing a missing package doesnt work, its almost always a pain in the butt to fix.

I’ve seen other suggestions to make sure (if youre on Ubuntu) you’ve done:

sudo apt-get install libmagick++-dev

Something else to look at is I notice youre on ruby 1.9.1? Its possible there are installation errors with the newest version of rmagick on 1.9.1, that it could potentially have been optimized for 1.9.3 instead

These are all just guesses though. Good luck!

(node) #5

Upgrading fixed the installation problem, but the lack of avatar image persists. This is what i’m seeing:

(node) #6

From what I’ve been reading all installations have uploads and avatars stores in /var/www/discourse I have no such directory on my system and have discourse installed only in /var/docker. Is this contributing, if so how would I go about building the /var/www/discourse directory.

(Kane York) #7

Please read this post about the Docker data model with Discourse: Advanced Troubleshooting with Docker

(node) #8

Thanks for that @riking i’ve installed the git. I’m still having trouble with broken images and also custom CSS is showing only in previews and not in the actual site. I think it may have something to do with my nginx config. I’ve pasted the code below:

server {
    return 301 https://$host$request_uri;
    listen 80;

#HTTPS server
server {
        listen 443 ssl;
         # spdy;

    ssl on;
    ssl_certificate /var/docker/shared/standalone/ssl/ssl-bundle.crt;
    ssl_certificate_key /var/docker/shared/standalone/ssl/;
    ssl_protocols TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ecdh_curve secp521r1;

    location / {
            access_log off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

I've read that adding
location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff|css)$ { try_files $uri =404; }``` will solve the problem, but it seems to have no effect.

**UPDATE:** Adding that line to discourse.conf disabled the stylesheet completely.

(Mittineague) #9

Assuming you’ve put in the correct information in the config, might it be the regex is looking for lowercase and the files have upper case? eg

image.jpg - works
image.JPG - doesn’t

(Kane York) #10

Well, I had been working on this for a while - good as any a time to release it:

You can see a live example at and .

(node) #11

It seems to be an issue with Firefox and Chrome as it works fine on Safari. After a few refreshes the avatars seem to come back. I think it might be a bug with these browsers.

(node) #13

Avatars seem to appear after a refresh of the page.