Quickbooks & Rails 5, can't create an invoice - ruby-on-rails-5

Things were working fine until I started the upgrade from Rails 4.2 to 5.0
Using qbo_api gem (1.8.1) which also now needs the simple_oauth (0.3.1) as well as the oauth (0.5.4) gem. (The faraday gem (0.14.0) is loaded as another dependency.)
I can successfully do get requests for invoice, customer, etc., so the keys and initialization of the qbo_api object are all working for qbo_api.get() but when I try to create an invoice with qbo_api.create(:invoice, payload: ...), I get the error:
Operation Could not find resource for relative : /v3/company/123145710499109/invoice of full path: https://sandbox.qbo.intuit.com/qbo50/v3/company/123145710499109/invoice is not supported.
The same qbo_api object is working for get, I see nothing obviously wrong with the URL, and it is unreleated to the JSON payload. I'm not sure where to look to debug this problem.
BTW, clicking on the URL above seems to go to QB just fine, returning a validation error as you would expect.

This turns out to be a problem in the 1.8.0 and 1.8.1 versions of the qbo_api gem. Minimul has released version 1.8.2 which fixes this problem.
Kudos to Minimul for a quick response to this.

check your realmId. Most probably realmId is not match to your connected intuit app. This is why its tells that Operation Could not find resource for relative.

Related

Is the ddd() helper not working in Laravel 9?

I upgraded to Laravel 9 the other day, and now the ddd() helper is failing with the error Call to undefined function ddd(). I found this post on the Laracasts forum, but at time of writing there is only a single reply that states that the facade/ignition was replaced with spatie/laravel-ignition. I did not see anything in the documentation for the new package that mentions anything changing with ddd(), is there an additional configuration or something that is needed to re-enable ddd()?
Take a look at this https://github.com/facade/ignition/pull/201#event-2712168617
jasonvarga deleted the ddd branch 2 years ago
And you are right about not seeing any documentation about it in changelogs as well.
I heard this ddd() helper for the first time from you, so thax for that.
Please do check out the documentation of both of the packages.
Here facade / ignition and spatie / laravel-ignition
Both packages saying the same thing that
spatie/laravel-ignition works for Laravel 8 and 9 applications running
on PHP 8.0 and above. Looking for Ignition for Laravel 5.x, 6.x or 7.x
or old PHP versions? facade/ignition is still compatible.
In spatie/laravel-ignition version 1.2.0, ddd() was added back in! If you are not able to use ddd(), first check your composer.json file to make sure that your spatie/laravel-ignition version is 1.2.0 or above.
"require-dev": {
"spatie/laravel-ignition": "^1.2.3"
}

Cocoa error 3840 Parse Code iOS7 only

Background: I decided a couple days ago that I was going to update Facebook SDK to FBSDKCoreKit from Facebook-iOS-SDK v3.24. I updated my Podfile accordingly and installed all libraries fine. I then began updating some of the code to work with the updated SDK spec.
After working on it for a short amount of time, I changed my mind and decided to rollback to the old version. I made all necessary cocoapods changes and installs, discarded all local changes in Xcode, recompiled and ran. Everything worked fine... or so I thought.
The Problem: Now, when I try to run on my old iOS7 test device, I get an error whenever the app launches. Below is the exact console output:
2015-10-15 20:14:31.271 hiatus[184:6003] [Error]: Failed to run command eventually with
error: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be
completed. (Cocoa error 3840.)" (JSON text did not start with array or object
and option to allow fragments not set.) UserInfo=0x14d67d20 {NSDebugDescription=
JSON text did not start with array or object and option to allow fragments not set.}
After this error is displayed in the console, no Parse functionality works. Which means, in my case, that a user is unable to login. An empty error is displayed instead.
Everything works fine on iOS8, and iOS9 (simulators and real devices). I'm working with Parse v1.9. I've tried cleaning the project, resetting, etc, but without any success.
I've been able to track this down to a specific function within PFEventuallyQueue.m. It seems to occur within (void)_runCommandsWithRetriesCount:. I just have no way of knowing how to fix it.
This is a known issue with SDK v1.9.0 (https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/388). It has been fixed but not released yet (it will be part of the 1.9.1 release).
You have 3 options :
Use 1.8.5 until 1.9.1 is released.
Fix the bug yourself by making this change : https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/commit/edde3bfa8a4476ba460dddbef6f75772960e1718
Use the master branch of the git repository to get the latest commits. If you're using cocoapods you can do it by setting your pod like this : pod 'Parse', :git => 'https://github.com/ParsePlatform/Parse-SDK-iOS-OSX.git'
Now is available Parse 1.9.1 but I recommend using CocoaPods for any Framework: https://cocoapods.org/pods/Parse

ruby rest_client exception

I try to use gem rest client to access some simple REST service, I have installed the rest-client following these instructions, but when try to use the library, I get the following error no such file to load -- rest_client.
It seems that the library is not recognized.
Did anyone have similar problems with this library?
Make sure you add it to your Gemfile, bundle install, restart server, and if required, require 'rest_client' or whatever the file name is.

RJS Handler missing

I got a missing template error when I tried to achieve a task using RJS.
All I want is to execute an RJS file on ajax call. But I am getting the
following error.
ActionView::MissingTemplate (Missing template line_items/create,
application/create with {:handlers=>[:erb, :builder, :coffee],
:formats=>[:js, :html], :locale=>[:en, :en]}. Searched in:
* "<MY APP PATH>/app/views"
):
app/controllers/line_items_controller.rb:46:in `create'
But the create.js.rjs is present in the folder /views/line_items. You
can see the handlers miss .rjs extension. I think thats causing the
error.
If I change .rjs to .erb, it works and the content is executed as
javascript and thus I need to modify the RJS functions to Javascript to
return the contents of AJAX call.
Could you please explain how I can attain this using RJS? Please help.
Following is the versions of tools I use.
Ruby version 1.9.2 (i686-linux)
RubyGems version 1.8.10
Rack version 1.3
Rails version 3.1.0
JavaScript Runtime Node.js (V8)
Active Record version 3.1.0
Action Pack version 3.1.0
Active Resource version 3.1.0
Action Mailer version 3.1.0
Active Support version 3.1.0
Thanks in advance.
in order to use RJS with Rails 3.1 you have to use the prototype-rails gem
Make sure prototype-rails gem is in bundler's production group. If you put it in the assets group it will not register the RJS template handler.

Custom Model - "no such file to load -- odbc"

I'm trying to create a custom model to interface with a database that isn't supported navtively by Rails or through the OpenLink ODBC driver. For some reason, I'm getting the following error:
no such file to load -- odbc
I'm at a lost as to why this is occurring as the ruby-odbc gem is in the GEM_PATH and I have a small script that tests this to ensure that the connection works and it worked perfectly. Does Rails ignore the gem_path? Is there something else I need to configure? I checked the GEM_PATH in Rails by writing it out to the browser and it matches what I saw in a terminal window.
FYI: I'm using rvm to manage ruby and all of my gems. Not sure if this makes any difference, though it really shouldn't from what I can tell.
Does your Gemfile include something like the following
gem 'ruby-odbc'