CSS problem with new diaspora installation ubuntu 16.04 xenial

My page from localhost come like this , the style sheet not works it seams if my observation is correct, please help me , I am a beginner

  • How to rectify this problem?
1 Like

I’m pretty new at this too, so this maybe too basic of troubleshooting for your problem.
Are you running in development mode? The assets aren’t precompiled in dev mode, afaik.

Do you try to install a development pod (because you access it via localhost)? It looks like you started it in production mode. When you want to install a production pod, you need a webserver that serves the static files.

That is wrong, assets don’t need to be precompiled in dev mode, they are served via the app server. In prod mode you need to precompile them and serve them via a webserver.

Hai,
I am running in production mode:

this is the line I executed

$ RAILS_ENV=production bin/rake assets:precompile
$ Then I got this prompt back without any message

Hai,
Yes, I started in production mode I think, do I have to start in development mode?

this is the line I executed

$ RAILS_ENV=production bin/rake assets:precompile
$ Then I got this prompt back without any message

in my diaspora.xml file , this is the setting

Rails environment (default=‘development’).

## The environment in which the server should be started by default.
## Change this to 'production' if you wish to run a production environment.
**rails_environment: 'production'**

when I changed to rails_environment: ‘development’

while running :
./script/server

The following error is comming:

bundler: failed to load command: unicorn (/home/diaspora/diaspora/vendor/bundle/ruby/2.3.0/bin/unicorn)

What to do to resolve it?

Ok, I may need some support, I an going to do it, setting the webserver, apache2 will be fine right?

I mean, if you want to use something old like apache.
I use the newness, nginx.
It doesn’t work, but it’s new.

@savyan Your distribution should have documentation for installing either Apache or Nginx. Since this process potentially differs between the distributions, we do not provide docs for that. Also, if you want to run a production pod, you should be comfortable managing that. :wink: Check https://gist.github.com/jhass/1355430 for an example nginx config and https://gist.github.com/jhass/719014 for an apache example config.

Could you, please, stop posting comments that are not helpful in solving an issue?

1 Like

That’s good, then I wll try nginx :+1:

What do you want to do? production and development are two totally different things. Production is when you want to install a Pod to use reachable from the internet. Development is when you want to install a Pod to develop with on your local computer. There are different installation guides for each setup and you can’t just switch by changing the mode (that’s why there is an error when you try it). Also it isn’t a good idea to switch to development mode when you want a production setup (or use production mode when you want to develop). That’s why I asked what you try to achieve?

But it looks like you try to install a production pod, then you need a webserver that works as reverse proxy and serves the static assets, as @denschub already mentioned.

Hey there.

What you encounter is NOT a bug.

This is my first day with diaspora, and i encountered the same thing, but this is by design.
these files, which cant be found should be hosted by a different webserver than the one buildin in diaspora.
However, there is a ‘dirty’ solution.

the quick & dirty solution:
Open diaspora.yml, and find the ‘Assets’ section, and set ‘serve=false’ to ‘serve=true’

`
assets: ## Section

  ## Serve static assets via the appserver (default=false).
  ## This is highly discouraged for production use. Let your reverse
  ## proxy/webserver do it by serving the files under public/ directly.
  serve: true

`

The elegant (preferred solution)

Run a NGINX or APACHE infront of your diaspora, and map the assets directory to the static files.
proxy all other requests to your diaspora webserver…
This gives you better performance… and you are in control of caching all kind of requests…

Good luck with ur diaspora adventure :slight_smile: