Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CSS when running tests #1931

Closed
dog1993 opened this issue Jul 22, 2018 · 24 comments
Closed

Invalid CSS when running tests #1931

dog1993 opened this issue Jul 22, 2018 · 24 comments
Labels
support A user needs help setting up their development environment

Comments

@dog1993
Copy link

dog1993 commented Jul 22, 2018

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?

@tomhughes
Copy link
Member

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.

@dog1993
Copy link
Author

dog1993 commented Jul 22, 2018

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?

@tomhughes
Copy link
Member

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

@carrieandal
Copy link

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?

@tomhughes
Copy link
Member

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.

@carrieandal
Copy link

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.

@tomhughes
Copy link
Member

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

@gravitystorm
Copy link
Collaborator

Reopening as per #1692 - this is an installation support issue (running tests) which @zerebubuth and I are happy to help with.

@gravitystorm gravitystorm reopened this Jul 23, 2018
@gravitystorm gravitystorm added the support A user needs help setting up their development environment label Jul 23, 2018
@gravitystorm
Copy link
Collaborator

@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.

@gravitystorm gravitystorm changed the title pngcrush not found Invalid CSS when running tests Jul 23, 2018
@dog1993
Copy link
Author

dog1993 commented Jul 23, 2018

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

@gravitystorm
Copy link
Collaborator

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!

@aliir74
Copy link

aliir74 commented Sep 8, 2018

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

@fazlerabbi37
Copy link
Contributor

@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.

@tomhughes
Copy link
Member

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

@fazlerabbi37
Copy link
Contributor

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?

@tomhughes
Copy link
Member

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

@fazlerabbi37
Copy link
Contributor

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.

@tomhughes
Copy link
Member

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.

@fazlerabbi37
Copy link
Contributor

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?

@tomhughes
Copy link
Member

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

@tomhughes
Copy link
Member

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

@fazlerabbi37
Copy link
Contributor

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,

@HolgerJeromin
Copy link
Contributor

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

@tomhughes
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support A user needs help setting up their development environment
Projects
None yet
Development

No branches or pull requests

7 participants