Openstreetmap-website: Invalid CSS when running tests

Created on 22 Jul 2018  ·  24Comments  ·  Source: openstreetmap/openstreetmap-website

When I Create the databases using"bundle exec rake db:create",it reports some errors like

“pngcrush not found,please provide proper binary or disable this worker()—no--pngcrush argument or‘:pngcrush →false’ through options ”.
“advpng not found,please provide proper binary or disable this worker()—no--advpng argument or‘:advpng →false’ through options ”.

It seems that these errors are related to image.Does the file "openstreetmap-website" on https://github.com/openstreetmap/openstreetmap-website.git lack some useful things?How can I fit it?

support

All 24 comments

So install it then.

Note that it's only a warning so it doesn't actually matter if it's not installed, it just means the images won't get optimised.

But when I Running the test"bundle exec rake test:db",it occurred "rake aborted. error:ENOENT:No such file or directory - phantoms".What's the matter?

I have no idea, but it's nothing to do with that warning.

I installed phantoms and ran the test"bundle exec rake test:db"again, the error above did't occur anymore, but there are some other errors, like this:

ActionView::Template::Error: Invalid CSS after "../common.scss": expected "{", was ""

Could you tell me how to solve this problem?

You installed "phantoms" despite neither of us knowing what is is? or did you mean "phantomjs"?

That should have been installed when you installed the gem bundle so it sounds like something is seriously wrong with your installation, or you haven't been following the instructions.

I'm sorry I made a spelling mistake, and what I mean is "phantomjs" actually. I'm so sorry. And I follow the instructions on https://github.com/openstreetmap/openstreetmap-website/blob/master/INSTALL.md strictly.

But there are many problems during the installation. When I ran the test"bundle exec rake test:db", there are more than 200 errors occurred,like this:

ActionView::Template::Error: Invalid CSS after "../common.scss": expected "{", was ""

I really don't know how to solve it ? And I think you may be able to solve these problems. I really need your help. Thank you very much.

I have no idea how to solve it because I have no idea what's causing it. You'll need to debug it.

Reopening as per https://github.com/openstreetmap/openstreetmap-website/issues/1692 - this is an installation support issue (running tests) which @zerebubuth and I are happy to help with.

@carrieandal could you please post the entire output from "bundle exec rake test:db" into a new gist at https://gist.github.com/ and add the link in a comment here. Could you also do the same for "git status" so that we can check that none of your files have been changed by mistake.

It doesn't seem to affect subsequent operations.Because I don't need something with graph. Thanks for your help.@gravitystorm@tomhughes

Closing due to no response from the reporter. If you can provide the debugging output that I mention above, then we can reopen this issue and help you solve the problem!

Hi all. I have same problem when run rake test:db and installing phantomjs didn't solve the problem.
@gravitystorm The entire output of bundle exec rake test:db is here: https://gist.github.com/aliir74/f760f662bdbc0c618eeab39abee29769

Thanks

@gravitystorm @tomhughes please take a look at this. I also am faccing the Errno::ENOENT: No such file or directory - phantomjs error provided on the previous comment while builing on docker.

Nobody is maintaining the docker configuration so it's very unlikely to work.

Nobody is maintaining the docker configuration so it's very unlikely to work.

@tomhughes I am working on the docker support and faced this issue while running bundle exec rake test:db. should have commented on the pull request #2272 though.

--
so any guesses why is it happening and how we may resolve it?

Well why it's happening is easy - you presumably don't have phantomjs installed.

Well why it's happening is easy - you presumably don't have phantomjs installed.

I don't think that's the case because I modified Gemfile to add phantomjs and after reinstall it still gives the same error.

Right but it's the phantomjs executable that's missing - the gem is just a bit of ruby that tries to figure out what platform it is running on and then use curl to download a suitable executable.

In can well imagine that docker is confusing it's attempt to identify the platform, or perhaps you don't have curl installed, or the network access isn't working - try looking for error messages as it tries to download and install phantomjs.

It's probably better to install phantomjs yourself if you can - it will probably be more reliable.

It's probably better to install phantomjs yourself if you can - it will probably be more reliable.

@tomhughes thanks for explaining that bit. Just to clearly by "install phantomjs yourself" do you mean install it via npm?

Not really, no. If this is Ubuntu that I'd just apt-get install phantomjs...

In more general terms if it isn't packaged then https://phantomjs.org/download.html is the place to start.

Not really, no. If this is Ubuntu that I'd just apt-get install phantomjs...

In more general terms if it isn't packaged then https://phantomjs.org/download.html is the place to start.

Though both Debian/Ubuntu has phantomjs in their official repo, running phantomjs from the terminal gives Could not connect to any X display. error.

We can use this method mention here to install phantomjs in a Debian/Ubuntu system. However, due to an error caused by a deprecated call to OpenSSL function causes it to stop working giving Auto configuration failed error in Debian.

Installation vai npm install phantomjs-prebuilt -g --unsafe-perm works fine,

Phantomjs is very old. Perhaps a good time to switch to headless chrome.

There are no good solutions sadly - cross-platform instructions for installing chrome are also non-trivial :-(

Or rather for installing chromium because we probably shouldn't insist on the googlified version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pangoSE picture pangoSE  ·  7Comments

zhouhana picture zhouhana  ·  6Comments

jidanni picture jidanni  ·  5Comments

eehpcm picture eehpcm  ·  4Comments

Zverik picture Zverik  ·  3Comments