I download a laravel project from live shared servel to local serve in laragon. When I serve the project, it throw the error "File does not exist at path" and pointed to the old pathe in the live serve. Image is attached. I tried config:clear and dump autoload but throw the same error
dump autoload and php artisan config:clear
Related
MY CODE BASE SETUP:
Ruby on Rails Deployed locally with Postgres
Production with Heroku (staging and production servers).
MY PROBLEM: Things are "seemingly" working on local machine (no hard errors) but NOT working in production. I believe my issue has to do with sending the proper information to the ruby, file.open() command.
I'm receiving the following error on my production(staging) server:
Errno::ENOENT in Projects#show
Showing /app/app/views/projects/show.html.erb where line #276 raised:
No such file or directory # rb_sysopen - https://[bucketname].s3.amazonaws.com/path/to/instance/of/file/file_name.stl
But if I take the resulting hyperlink and copy / paste it into my web browser, the file open / download menu is prompted. What am I doing wrong here?
BACKGROUND / HISTORY:
I haven't been able to resolve and I've scoured much of the stackoverflow questions looking for answers:
ENOENT, no such file or directory but file exists ()
File Exists But Receiving ENOENT Error (I'm not using node and my server restarts everytime I deploy)
Rails 3: Errno::ENOENT exception (if CentOS is like Heroku, then we have a similar issue which no one seems to be able to answer). Not sure about my Tmp file situation. But this question sounds similar to my issue.
Carrierwave, Rails 4; Errno::ENOENT (No such file or directory - identify) (might be relevant, but I'm not pulling an imagemagick file, I'm trying to parse a non-image file)
Remove "www", "http://" from string (I tried stripping various portions of my path in order to feed the file.open() command the right format to no avail
File.open, open and IO.foreach in Ruby, what is the difference? (this helped me understand the difference between each command type, which might be my issue).
Open an IO stream from a local file or url (sounds again like a reliable fix but I don't know how to utilize this open command as the gem specifies a file.open() command vs. these open() commands).
I defined the following method in my "project model" (project.rb) which takes the project file from a particular instance and from the "project_file path" input, the gem parses an STL file for my webapp.
This particular gem--"STL_parser"--calls a file.open(filepath,'rb') command which is where I believe my app is running into issues. Here's the method I call in my model which calls the STL_parser gem:
def analyze_STL project_file
if Rails.env.development? || Rails.env.test?
full_path = project_file.current_path
else
full_path = project_file.url.to_s
end
parser = STLParser.new
parser.process(full_path)
end
The RESULTS from each case and environment are as follows:
In Development:
project_file.current_path
...for one particular instance yields on my mac:
/Users/myname/full/path/to/file/on/laptop/unique_instance_file.stl
RESULT: app works on local machine AND if I copy/paste the above path into a web browser like Chrome, it prompts a file open / download menu.
In Production Environment:
project_file.current_path
RESULT:
Errno::ENOENT error - No such file or directory # rb_sysopen
-uploads/project/project_file/instance/instance_file.stl
and clearly lacks a subdomain, so in Production, I modified the path to call the file URL from AWS as seen above:
project_file.url.to_s
https://[bucketname].s3.amazonaws.com/path/to/instance/of/file/file_name.stl
RESULT:
Errno::ENOENT error - No such file or directory # rb_sysopen
-https://[bucketname].s3.amazonaws.com/path/to/instance/of/file/file_name.stl
...but if I copy / paste that path into my web browser, the file will prompt an open / download menu.
Thus the path seems to be pointing towards the correct to the file, but the file.open() command doesn't like that path format. Thoughts? I've been banging my head now for some time!
Possibilities:
Is it a permissions thing with AWS? If so, why would other image files produced by other ruby Gems open fine in the same AWS bucket?
When I apply the full-path as a hack...the URL format for my development environment, by simply creating a variable: hacked_path = "localhost:3000"+file_path
...this generates the Errno::ENOENT No such file or directory # rb_sysopen error. But I can copy / paste that same path in my web browser and it opens a download prompt. So it seems like my browser is piecing together some information about how to open the file, but the Gem I'm calling in my webapp isn't that flexible. A friend of mine said something about my webapp not being able to read the "binary" while my local machine can?
Is this an issue of file.open(filename, 'rb') vs. open(filename, 'rb')? I wouldn't even know how to modify the gem, but I could ask the developers for help.
Is this because the my app doesn't have enough time to download the file from AWS before it tries to process the file?
CORS permissions in AWS?
Something else more simple I haven't thought of?
Thanks in advance for your help and feedback! Yes I know I need more programming fundamentals courses. Any online ones you'd recommend? Already took the one from onemonth.
I've just deployed my app to heroku and I'm having a lot of trouble trying to read some assets.
I am trying to dynamically load some css from multiple files, then recompile them with some changes later. The line that keeps breaking is the first file load:
#css_asset_bootstrap = File.open(ActionController::Base.helpers.asset_path('bootstrap.css'), "r").read
which generates this error:
2015-04-07T23:30:50.098831+00:00 app[web.1]: Errno::ENOENT (No such file or directory # rb_sysopen - /assets/bootstrap-2d25733981c30e34bd9aa0fb75388f08.css):
I've tried a lot of things, including moving all my assets to aws cloudfront. Is there a way to get around this? Works perfectly in development environment.
Just to confirm a few things. I've successfully precompiled and uploaded the file. The file definately exists as I can see it in
heroku run bash
cd /public/assets/
I can also see it when I moved the assets to cloudfront.
Thanks.
edit 1:
Not sure if this is important information, but with the file on cloudfront, I can run heroku run bash to start a shell session on heroku. Then I can:
curl http://xxx.cloudfront.net/assets/bootstrap-2d25733981c30e34bd9aa0fb75388f08.css
And get the file ok. I was thinking maybe it was a permissions error but everything is set to public and it all seems to work from heroku to the aws server.
You're asking for the file from a relative path, which might not always work. Try absolute:
#css_asset_bootstrap = File.open(Rails.root + ActionController::Base.helpers.asset_path('bootstrap.css'), "r").read
Another possibly bigger problem is that Heroku has an ephemeral filesystem, and so any changes you write to it can be obliterated at any time when the dyno is culled.
In my case, using a virtual machine Rails.root give me this: '/home/vagrant/projects/.../my-nice-app' what is totally uncool.
I use instead request.url with give me: 'http://localhost:3000/' what it is exactly what I want.
I have a RoR (4.1) app that I'm trying to deploy, using Passenger & Nginx. I'm trying to avoid running "bundle install" on the web server. I ran "bundle install --deployment" on my build server, zipped up the whole folder and shipped it to the web server. But now I'm getting this error:
libruby.so.1.9: cannot open shared object file: No such file or directory - /var/www/foo_app/vendor/bundle/ruby/1.9.1/gems/pg-0.17.1/lib/pg_ext.so (LoadError)
The file does exist, and has read & execute permissions for all users (and rwx for the user I think passenger is running as). Any ideas what I'm missing?
I've had no end of problems getting this working, should I just give in and bundle on the target machine?
I have a Ruby on Rails website which I have successfully tar the apps directory which included the current folder ect. Which I Wget to transfer the files over. The server I have moved to is setup to run Ruby on Rails but is there anything else I need todo to get it running?
Any commands via SSH?
My new server setups is Ubuntu 11.04 running ISPConfig 3 as the server admin.
Current the file are in the correct location with the correct permissions and owners. But all I'm getting is the default ISPConfig page.
(This is the default index page of your website.
This file may be deleted or overwritten without any difficulty. This is produced by the file index.html in the web directory.)
If anyone can point me in the right direction that would be great.
Have you tried creating a symbolic link on the server to the application something like
cd ~/public_html;
ln -s ~/rails-test-application/public rails3
http://www.site5.com/blog/programming/ruby-rails/how-to-deploy-phusion-passenger-to-a-subdirectory-routing-errors-and-restarting/20090414/
I'm trying out a Q&A application written in rails 3.1 on my Ubuntu system. After I run the server (rails server), and enter the localhost:3000 url in the browser, I'm getting the following error:
/var/lib/gems/1.8/gems/jquery-rails-1.0.14/vendor/assets/javascripts/jquery.js isn't in paths:
(...."displays a list of paths including /$home/myapp/jquery-rails/ruby/1.9.1/gems/jquery-rails-1.0.14/vendor/assets/javascripts".....).
I did bundle update and it installed the jquery.js and all other .js files in that last path. But I'm still getting the same error. Any suggestions about what I might be doing wrong here?
P.S. When I enter the URL localhost:3000, it actually tries to open the URL: http://localhost:3000/session/new. Must be some application specific logic.
Remove everything in your /tmp directory and restart the Rails app.
Fixes it for me.