I am basically having the exact same issue as this user on this question:
Rspec cannot load error
Specifically, when I look at the error log, I see that for some reason it is adding an extra "/spec" to the file path in loading the static_pages_spec.rb file
/Users/anantvinjamoori/.rvm/gems/ruby-2.1.1#railstutorial_rails_4_0/gems/rspec-core-
2.13.1/lib/rspec/core/configuration.rb:819:in `load': cannot load such file --
/Users/anantvinjamoori/helpondemand/sample_app2/spec/spec/requests/static_pages_spec.rb
(LoadError)
This directory does not exist on my computer, so it is no surprise that this error is being generated. However, I am not sure how to stop it from doing this. The previous user just said he "would check his commits" and never followed up. How can I stop RSpec from doing this incorrect path assignment?
Because it seems others have had this problem, thought I would contribute my mistake (even though it may seem stupid)
I was executing rspec from the wrong directory from the terminal (ie i was executing it from the spec directory itself, which was probably the reason the extra /spec was being added.
Bottom line: restarting your terminal never hurts!
Related
I was just working on one of my models when my Rails app would not work anymore. Even typing out commands like rails -v, rails, c, bundle install, or any command is giving out the same error. What's causing it is a syntax error on the file fileutils.rb. I'm using the ruby version ruby-1.9.3-p551.
First set of error messages.
(I have not included the middle part of the error messages.)
Last set of error messages.
I do not understand as to what caused the file fileutils.rb to be modified or be syntax errored.
I have modified the fileutils.rb by copy-pasting lines 309-421 from another fileutils.rb file.
I got it working again but I am still confused as to what corrupted my file.
`':' while scanning a simple key at line 16 column 1(Psych::SyntaxError)
I'm working on a Rails application tutorial and have had the above error come up several times. When I was getting this error it seemed to only be a problem if I used one particular terminal window. I have since restarted the computer and now it is a problem regardless of what I do.
I went to the project on github and copied the information in 'secrets.yml' into my file in case that was the issue but doesn't help. In fact I'm not sure if that is even the file causing the problem because when I shift the code in that file and save it I still get the same error; at those times it points to a line that is now blank in the 'secrets.yml'
Update.
now I am getting this when i run this command
rails generate simple_form:install --foundation
-bash: $: command not found.
only change I did was start the code in 'secrets.yml' lower down, and i added a secret key to my .bash_profile, as it was suggested in tutorial and I had not done it before, and thought that might be the problem.
Update 2
shut down terminal and tied again and getting the original problem "psyche Error" Yes, thank you for your feedback, I too, although not sure why, suspect it is to do with the 'secret' file or could it be changes the tutorial told me to make to my .bash_profile. The instructions were not very clear, wondering if that is where I messed up. If that is so then I would not know how to fix that.
The Psych gem is the wrapper around libyaml and used within Ruby's YAML class, so it's not surprising you think it could be the 'secrets.yml'; a YAML config file. I'd stay the course and find what isn't being formatted correctly.
I'm working on a Rails app and using Less. I've just save my project after editing a change on a .less file, and now I'm showing an error which reads:
Less::ParseError at /
Operation on an invalid type
(in /Users/USERNAME/Desktop/PROJECTNAME/app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less)
There's no error in the file above, but upon a deeper look, Better Errors is showing a path to :
() usr/local/rvmruby-2.1.1#PROJECTNAME/gems/less-2.5.0/lib/less/js/lib/less/parser.js
The problem is that the above file doesn't exist. I think it's looking for the file that exists:
/usr/local/rvm/gems/ruby-2.1.1#PROJECTNAME/gems/less-2.5.0/lib/less/js/lib/less/parser.js
Is there anyway to point to that file?
Thanks ahead of time
I found the error. At least, now my project is working (=
custom_bootstrap.less pre-imports a ton of custom modification files which aren't needed. Deleting these file fixed my issue.
Just for backup though, save this file elsewhere.
I'm using PDFKit to create pdfs of from a given url within a Resque job on Heroku Cedar. My code looks like:
kit = PDFKit.new(url)
pdf = kit.to_file("/tmp/#{SecureRandom.hex}.pdf")
I then upload the file using fog to S3 for permanent storage. This job usually works, but also fails maybe a third of the time with:
No such file or directory - /tmp/a05c165fc80878b75fd15c447695de71.pdf
Manually running through the code in console will produce the same error.
According to the Heroku docs, I should be able to write a temporary file anywhere in the app's directory on Cedar. I've tried creating the tmp directory first (in console) but that didn't seem to change anything. Neither did saving to "#{Rails.root}/tmp/#{SecureRandom.hex}.pdf".
Any ideas would be greatly appreciated.
UPDATE
The full error in console is:
Error: Failed loading page http://grist.org/living/you-look-great-in-green-clothing-industry-gets-a-makeover-maybe.html
(sometimes it will work just to ignore this error with --load-error-handling ignore)
Errno::ENOENT: No such file or directory - /tmp/55a1d418074736decfd4e123d8e2bba2.pdf
It seems that maybe this is an error coming from wkhtmltopdf, however, I'm not sure where to add this flag if I'm using wkhtmltopdf via PDFkit.
Looks like the solution, as the error I posted second suggested, was to ignore the load error. I did this with:
PDFKit.configure do |config|
config.default_options[:load_error_handling] = 'ignore'
end
I wasn't seeing this warning at first because Resque was only showing me the final error. Thanks #ctshryock, your question made me think a little more about exactly where this error was coming from.
I'm having a problem with deploying a Rails 3 app to a Passenger/Apache2/RVM server running Ubuntu 11.10.
I'm getting the error:
A source file that the application requires, is missing.
...
Error message: No such file to load -- Goal
Exception class: LoadError
Goal is one of my Rails Models.
I've seen a lot of people with a similar error message, but their issues seem to relate to missing bundles/gems - not model files! Their problems were resolved by ensuring permissions were set up correctly, so to that end I've got:
Apache running as www-data, as is Passenger. RVM is installed as www-data and I've chown'd the entire web app directory to www-data.
I've been wrestling with this for some time now and am really out of ideas - if anyone has any suggestions I'd be very grateful!
You might probably have the file structure of your Rails app wrong. Are you sure you have the "goal.rb" file within {your_app_root_url}/app/models/ ?
To me, if I am seeing the error when you view the app in browser, it seems like your rails app and passenger(with apache2) are working fine. The other possibility is you might be looking at wrong app folder which passenger is set up to.
It's hard to tell what's wrong. Please provide more details of how you set up your passenger with your rails app directory. Also it would help if you could show what's inside your app (app structure) and what's inside goal.rb model file.
Well I've solved it. Turned out that a work around for a problem with yaml encoded model archives (i.e. an explicit require of Goal) in a completely unrelated Model was causing the error to appear. Looks like it only rears its head in production - probably due to the differences between the class loaders used in development vs. production.
Tough one to find... the stack trace didn't include a reference to where the problem actually was!