Heroku - ActionView::Template::Error - ruby-on-rails

I adding in my rails app "audiojs" music player (http://kolber.github.com/audiojs/)
on localhost all good and work, but heroku says:
"We're sorry, but something went wrong."
log
ActionView::Template::Error (audiojs/audio.min.js isn't precompiled)
how to solve the problem?

The problem is in your main page javascript. You're trying to load a track, but the elements you're looking for don't exist so you're getting the undefined error.
var audio = a[0];
first = $('ol a').attr('data-src');
// Add this code to layouts/application.html.erb
// First is coming back undefined on your root route.
if (first == undefined)
console.log("First is undefined! Will cause error in audio track");
$('ol li').first().addClass('playing');
audio.load(first);
Whereas, you're setting data-src="<%= show.preview %>" in releases/show.html.erb (and index.html.erb) and the code works without issue there.
Your options are to detect if there are no order list items and not try to automatically play an audio track, or add audio tracks to your main page.

Related

SwiftUI Firebase Auth Error "Paths must not contain // in them"

In my SwiftUI app I suddenly started getting this error once my user logs in (I use Firebase Phone Auth)". It happens right as soon as I do this:
let db = Firestore.firestore()
db.collection("user").document(user.UID)
.getDocument { document, err in
This is the error, the app crashes totally:
Invalid path (com.googleusercontent.apps.178114301509-gvnp7pp9tm6jq9s4rridgoae9glog8nj://firebaseauth/link?deep_link_id=https%3A%2F%2Fgigas-4f2dd.firebaseapp.com%2F__%2Fauth%2Fcallback%3FauthType%3DverifyApp%26recaptchaToken%3DTOKEN%26eventId%3Dmwkcoldfan). Paths must not contain // in them."
I tried reverting back my project with Github but I cannot find whatever happened that started all this. I don't even know what Path is the debugger talking about. I have seen people in other cases saying that maybe it is the id being empty so a / and another / collapse into a // making it causing such an error but it is not my case since I am sure the id is not empty.

Sound Effect Won't Play (XCode/Swift)

So I am following through an old tutorial and I think with the changes in xcode and swift this code is now no longer usable, but i am not sure. Would love some help.
Declaring constant for the audio effect
let cannonSound = SKAction.playSoundFileNamed("cannon.wav", waitForCompletion: false)
Calling the audio effect within my funtion
let hotdogSequence = SKAction.sequence([cannonSound, moveHotdog, deleteHotdog])
hotdog.run(hotdogSequence)
For more info I am using SpriteKit in Xcode and this code is contained within GameScene.swift file.
Update:
The error I receive is
2017-03-30 00:52:43.631 Ballpark Weiner[95999:1983181] SKAction: Error loading sound resource: "cannon.wav"
The game doesn't crash just no sound plays
This message usually means that the file cannot be found in your project or might be corrupt.
You should check that the file is actually copied into your project and is spelled correctly. Its case sensitive so if the actual file is called "Cannon.wav" it will not work.
Hope this helps

Error in iOS: "you don't have permission"

I'm working on an iOS project in Swift which uses the Dropbox API to upload text files to Dropbox as well as load and read them from Dropbox. However, when I try to load a file using my DBRestClient using the following line:
restClient.loadFile("/data/" + yearStr + "/" + yearMonthStr + "/" + fullStr + ".txt", atRev: nil, intoPath: "temp2.txt")
I see the following error message in the console:
DropboxSDK: error making request to /1/files/sandbox/data/15/15_12/15_12_10.txt - (404) Path is a directory`
I'm not really sure what this means, since neither path involved in the call looks like a directory to me. I've searched for this error message but I can't seem to find it anywhere online, and I'm not sure what else might have caused it since commenting out this line prevents the error fro showing up and the same filepath works fine in other calls that don't involve loading files. Am I missing something about how loadFile() works?
UPDATE: I fixed the previous error by deleting a directory with the that filepath, making it choose the correct file. However, I am now getting the following error instead:
DropboxSDK: error making request to /1/files/sandbox/data/15/15_12/15_12_10.txt - (513) Error Domain=NSCocoaErrorDomain Code=513 "The file couldn’t be saved because you don’t have permission." UserInfo={path=/data/15/15_12/15_12_10.txt, destinationPath=temp2.txt}
I'm not sure what it means-- do I not have permission for the destination on my phone, or for the file on dropbox? I'm looking up this error message but I'm not finding anything yet, so help would be much appreciated.
According to the documentation, code 513 corresponds to:
NSFileWriteNoPermissionError = 513,
That seems to match the error message you get, and should be referring to the local destination path, which in your case is:
temp2.txt
You should check that you have access to write to that local path, and that it's a valid path, e.g., should it start with a '/'?. (Or moreover, perhaps you should be writing to NSTemporaryDirectory or something like that.)

AVErrorFailedToParse error thrown

Can anyone provide anymore information on why I might get AVErrorFailedToParse when using MPMoviePlayerViewController.
AVError.h lists the error, but doesn't provide any other info.
AVErrorFailedToParse NS_AVAILABLE(10_10, 8_0) = -11853,
The error happens intermittently. So I'll try and play a mp4 and it will fail with this error, i'll try again immediately afterwards and it works.

How to print PDF file already opened in QLPreviewController using print button?

I get binary array then convert it and save in Documents folder and then showed in QLPreviewController. I have seen the right button on the tool bar of QLPreviewController.
I want to print that is in the preview right now. But when i tab error occurs
*** Assertion failure in -[UIDocumentInteractionController setURL:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIDocumentInteractionController.m:960
Also please guide me about printing that document. I have read about UIPrintInteractionController.
Why this Error occurs because you have set the URL wrong.
You are setting url like that;
/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf
Where as UIDocumentationController task URL as:
file://localhost/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf
This minor mistake will made you mad ;)

Resources