I am writing a Meteor application template to illustrate various elementary features and am not able to serve a file from the public/ directory:
Yet this file exists in the public/images directory.
What am I doing wrong?
OK, I really hate to say this, but all of a sudden, it just started to work. The fact that others have run my app and encountered the same issue makes this even stranger.
The repo's README now illustrates the appropriate behavior where the image is successfully displayed on the home page using:
<img style="float:left" width="240px" class="img-circle" src="/images/meteor-logo.png" />
I am at a loss to explain this.
Fixed. The problem was that the .meteor directory was not in the app/ directory, but in the directory above it.
This didn't cause any problems until trying to retrieve a static asset.
Related
I have a simple query, a bit embarrassing as well. Dtube is an app that runs using meteor. I am looking to make some changes on the Dtube Home Page..changing icons and such. I have installed it on a linode. However, I am simply not able to locate the index file to make these changes to.
I tried
Locating all the files on linux named index.html in the dtube directory
Locating all the files containing the string div class name ...I was looking for in the dtube home page.
Still no luck.
Documentation is scarce and a bit confusing..
Can anyone simply point me to the path I should be looking at to modify the dtube homepage?
Someone who knows Dtube might be able to answer this.
All HTML's and CSS files are in https://github.com/dtube/dtube/tree/master/client
It's necessary rebuild the system to see the results.
I have deploy my Symfony 3.1 application and uploaded it online, following the symfony 3.1 cookbook steps (basic file transfer and common post-deployment tasks); I have checked all the requirements, install vendors, clear cache, and install all assets, but no images, css configurations nor js files are loading. I can only see the raw content.
any idea of what I can do?
thanks.
I can't write a comment, cause have no reputation so I hope my advices will be like answer.
First solution very simple. Check the permissions of your web directory.
chmod -R 0777 ./web
Check the config file (or post it's code here).
check if your paths are relative, something like:
href="/images/myimage.jpg"
Where images - folder which contains in web directory
And from my opinion try to clear cache once more in both dev and prod.
I've recently switched from PHP to JS Meteor+ReactJS. I've started my first project and almost instantly got a bump in the road.
I cannot seem to get image in my scss file to work. Same with trying to get to it via url in my browser. In the browser I get flow-router error about missing path. Scss doesn't give me any errors just doesn't work.
I've tried every possible link variation I've found online.
absolute_path, relative_path, {}absolute_path, {}relative_path, even just putting the image in the same directory as the scss and linking to it in the same directory. Nothing seems to work.
I'd greatly appreciate any help.
Put images and other shared content for the client in your project's public directory. public gets mapped to / so you can refer to them with <img src='/images/mypicture.png'>
If you want an images directory then put them in public/images and refer to them as <img src='/images/mypicture.png'>
I've recently deployed a project on Heroku and fixed most asset pipeline issues such that my stylesheets and javascript files work. However, I have one line of code in a css file that I thought would work based on documentation and other stackoverflow topics:
background-image: image-url("giphy.gif");
I got that line directly from another stackoverflow solution, given that my original code was simply url("giphy.gif"). Loading the page with either code gives me a 404 in the console. The project is structured like a rails app, so the app->assets folder has:
images
giphy.gif
stylesheets
javascript.
I've tried asset-url, image-url, url, "images/giphy.gif", "giphy.gif". Many iterations have been tried. I figure this should be a simple switch, but I'm not sure what I'm missing. Would appreciate all assistance! Thanks
Update:
Error message: GET https://herokuappname.herokuapp.com/assets/giphy.gif 404 (Not Found)
I even tried just moving the gif so that it lies in the assets folder instead of the images subfolder.
Try background-image: url('giphy.gif');
Background images declared in CSS must be in a .css.erb file, application.css.erb, for example.
I've found this syntax works:
background-image:url('<%= asset_path("giphy.gif") %> ');
But again, it must be in an .erb file in order to properly reference the asset pipeline.
Good luck.
Have you tried manually
heroku run rake assets:precompile
Then pushing again?
Is your master branch on git up to date? Have you pushed to git git push origin master, then git push heroku master
Just listing some things I would try
My less style sheets are located in my /public folder for now. I'm trying implement them on my meteor app but to no avail.
This is the error I get:
The stylesheets are located in the /less folder, which is inside the public folder, so the URL should be correct. By the way, all those files that are in the screenshot above are files that import dozens of other variables located deeper in the folder.
I also checked and I have the latest version of less installed. Any help would be appreciated.
The public folder isn't the right place to store the files. Files stored in a “public” folder are served to visitors. These are files like images, favicons, and the “robots.txt” file. So they get served 'as-is', not processed by LESS and served as CSS.
More about Meteor folder conventions.
After discussion in the comments, it seems something is not working right in your less compiler, the less file should not be in the public folder, as already mentioned, and you should not need to include it with a script tag. You can follow these steps to create a new app and test less and see if you can find a difference between this and your current app.
Create a new meteor project
meteor create test
Add less
cd test
meteor add less
Start your server
meteor
add a file sytles.less to the top level folder with this...
.fun {
color: red;
}
Update the test.html file to add the fun class to the text output...
<div class="fun"><p>You've pressed the button {{counter}} times.</p></div>
Load the page, the text should pick up the class and become red. No link to the styles.less file needed. You can try moving it around to different folders, it worked fine from client for me as well. Look around and see what else might be different.
If you still have issues, try providing more information on how the project is set up.