Persistent error when installing package terra - testing if installed package can be loaded from temporary location - compilation

When trying to install terra like so
Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
remotes::install_github("rspatial/terra")
It starts to compile the package, resulting in a lot of output in the console, but ending in the error (error at bottom):
lhdf5 -lsz -lpng16 -lpng -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 -lpcre -lcurl -lrtmp -lssl -lssh2 -lidn2 -lunistring -liconv -lgcrypt -lcrypto -lgpg-error -lws2_32 -ltiff -llzma -ljpeg -lz -lcfitsio -lzstd -lwebpdecoder -lwebp -lsbml-static -lgeotiff -lproj -lsqlite3 -lbz2 -lcrypt32 -lwldap32 -lsecur32 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.2/bin/x64 -lR
installing to C:/PackagesR/00LOCK-terra/00new/terra/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
in method for 'sds' with signature 'x="stars"': no definition for class "stars"
in method for 'sds' with signature 'x="stars_proxy"': no definition for class "stars_proxy"
in method for 'svc' with signature 'x="sf"': no definition for class "sf"
in method for 'coerce' with signature '"stars","SpatRasterDataset"': no definition for class "stars"
in method for 'coerce' with signature '"ggmap","SpatRaster"': no definition for class "ggmap"
in method for 'coerce' with signature '"sf","SpatRaster"': no definition for class "sf"
in method for 'coerce' with signature '"sf","SpatVector"': no definition for class "sf"
in method for 'coerce' with signature '"sfc","SpatVector"': no definition for class "sfc"
in method for 'coerce' with signature '"sfg","SpatVector"': no definition for class "sfg"
in method for 'coerce' with signature '"XY","SpatVector"': no definition for class "XY"
in method for 'coerce' with signature '"im","SpatRaster"': no definition for class "im"
in method for 'coerce' with signature '"SpatVector","Spatial"': no definition for class "Spatial"
in method for 'coerce' with signature '"Spatial","SpatVector"': no definition for class "Spatial"
in method for 'coerce' with signature '"SpatialGrid","SpatRaster"': no definition for class "SpatialGrid"
in method for 'coerce' with signature '"SpatialPixels","SpatRaster"': no definition for class "SpatialPixels"
in method for 'crs' with signature '"sf"': no definition for class "sf"
Creating a generic function for 'ncol' from package 'base' in package 'terra'
in method for 'distance' with signature 'x="SpatRaster",y="sf"': no definition for class "sf"
in method for 'ext' with signature 'x="sf"': no definition for class "sf"
in method for 'ext' with signature 'x="bbox"': no definition for class "bbox"
in method for 'ext' with signature 'x="Extent"': no definition for class "Extent"
in method for 'ext' with signature 'x="Raster"': no definition for class "Raster"
in method for 'ext' with signature 'x="Spatial"': no definition for class "Spatial"
in method for 'extract' with signature 'x="SpatRaster",y="sf"': no definition for class "sf"
in method for 'mask' with signature 'x="SpatRaster",mask="sf"': no definition for class "sf"
Creating a generic function for 'unserialize' from package 'base' in package 'terra'
Creating a generic function for 'readRDS' from package 'base' in package 'terra'
in method for 'lines' with signature 'x="leaflet"': no definition for class "leaflet"
in method for 'points' with signature 'x="leaflet"': no definition for class "leaflet"
in method for 'rast' with signature 'x="stars"': no definition for class "stars"
in method for 'rast' with signature 'x="stars_proxy"': no definition for class "stars_proxy"
in method for 'rasterize' with signature 'x="sf",y="SpatRaster"': no definition for class "sf"
in method for 'show' with signature '"Rcpp_SpatDataFrame"': no definition for class "Rcpp_SpatDataFrame"
in method for 'show' with signature '"Rcpp_SpatCategories"': no definition for class "Rcpp_SpatCategories"
in method for 'geomtype' with signature 'x="Spatial"': no definition for class "Spatial"
in method for 'vect' with signature 'x="Spatial"': no definition for class "Spatial"
in method for 'vect' with signature 'x="sf"': no definition for class "sf"
in method for 'vect' with signature 'x="sfc"': no definition for class "sfc"
in method for 'vect' with signature 'x="XY"': no definition for class "XY"
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
ERROR: loading failed
* removing 'C:/PackagesR/terra'
* restoring previous 'C:/PackagesR/terra'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/CORNVA~1/AppData/Local/Temp/Rtmp6Pz2Jn/file1eac467567ab/terra_1.6-44.tar.gz’ had non-zero exit status
Cannot figure out what is going on. Is someone able to provide some insight in how to fix this?
I have the most up to date Rtools, R and RStudio. I also have Rccp installed.
Greetings!

The easiest way to install the development version of "terra" on windows is
install.packages('terra', repos='https://rspatial.r-universe.dev')
The version you get is at most a couple of hours behind the github version, but it is already compiled.
To install from github, you need the latest version of RTools. It is also very important that you start with a clean session (no packages loaded, see sessionInfo(); and make sure you do not load a prior session when starting your R session.

Related

Mockery: Method does not exist on mock object

So I have an object which I am mocking and it has methods that are used for sending emails. I have gone from a static class over to a concrete class because I was having issues testing the static class with Mockery.
However I am now finding that when an eloquent model is saved it throws an event which fires off a listener. This listener is what is responsible for kicking off the call to the mock objects method.
I have found that when I do something like the following it works.
$model = factory(MyClass::class)->make();
$model->property = 'value';
$model->save()
$this->mailer->shouldHaveReceived('methodName')->with($arg1, $arg2, $arg3);
It will fail every time complaining that the method does not exist on the mock object, the worst part is if I go into my listener where the mock object method is called and I do something like this
echo '<pre>'.print_r(get_class_methods($this->mailer), true).'</pre>'; exit;
it shows that the method is in-fact in the array of methods returned from get_class_methods.
Now here is the kicker. Everything works perfectly and the test passes without any errors if I do the following:
$this->mailer->shouldReceive('methodName');
$model = factory(MyClass::class)->make();
$model->property = 'value';
$model->save()
Now I have been reading the Mockery Gotchas and it would appear that if my class was calling a method that truly didn't exist on the object via ___call then this error would be expected.
However my mailer class is NOT extending any other class that would have a __call method nor does it have that method defined on the class.
However as you may or may not know Eloquent Models do in-fact use the magic ___call method. However I am NOT mocking the model with Mockery, I am using factory models in Laravel but I am also not checking the model object for the method call, I am checking my concrete mailer class for the method call.
Anyone know why I might be getting this behavior from Mockery?
I am creating my mock object in Laravel 5.2 with the following code
public function mock($class)
{
$mock = Mockery::mock($class);
$this->app->instance($class, $mock);
return $mock;
}
$this->mailer = $this->mock('Namespace\Classname');
How are you creating $this->mailer? In order to be able to use the spy functionality ->shouldHaveReceived, you need to have invoked Mockery::spy($className) or called the shouldIgnoreMissing method after creating the test double with Mockery::mock($className).

Message: Call to undefined method CI_Input::manufacturer()

can somebody tell me what's wrong with this code? This is located in my controller. I have an error message "Message: Call to undefined method CI_Input::manufacturer()"
public function edit_manufacturer(){
$this->load->helper("security");
$id = $this->uri->segment(3);
if($this->input->manufacturer('submit')){
$manufacturer_name = $this->security->xss_clean($this->input->manufacturer('manufacturer_name'));
$this->asset_model->edit_manufacturer($manufacturer_id, $manufacturer_name);
}
}
input is a reserved class from CodeIgniter and the methods are the following
$this->input->post();
$this->input->get();
$this->input->cookie();
$this->input->server();
therefore, manufacturer method doesn't exist unless you modified this class and created the method.
Maybe what you want to do is:
$this->input->post('manufacturer');
or
$this->input->post('submit');
For more information visit Input Class Documentation

Magento - Fatal error(s) after installing module

Just installed Product Accessories on Magento ver. 1.8.0.0
And my whole website went on fatal errors.
Fatal error: Call to a member function getCollection() on a non-object
Fatal error: Call to a member function setStoreId() on a non-object
Fatal error: Class 'Anais_Accessories_Model_Product'
What do I need to do to get the module running smooth? I can't find an other module that does the same like this one.
Your Model file name should be like this-->> AnaisAccessories.php. Rename all the classes in the Model folder start with the Uppercase and rest should be lowercase as AnaisAccessories. As you can see you've error in class 'Anais_Accessories_Model_Product'.
Make sure file ../Model/AnaisAccessories.php should contain below code. Make appropriate change according to your Module.
class Anais_Accessories_Model_Accessories extends Mage_Core_Model_Abstract
{
public function _construct()
{
parent::_construct();
$this->_init('accessories/accessories');
}
}

Extend CodeIgniter Base Model causes Fatal error: Class 'MY_Model' not found

I want to extend CI_Model:
<?php
class ModelBasic extends CI_Model
{
}
?>
It won't be autoloaded unless under such a path:
./application/core/MY_Model.php
It seems name of MY_Model.php is mandatory. Now my problem is that when I create MY_Model.php CodeIgniter Expects me to have a model under name of MY_Model which I want to avoid. Can I have my own custom model name without making a fake class to suppress this error?
Fatal error: Class 'MY_Model' not found in /var/www/CodeIgniter/system/core/Common.php on line 174
The quickest way to achieve naming your own custom base model(s) without any additional modification is to create the file application/core/MY_Model.php, define an empty MY_Model class, and then create your own custom class(es):
class MY_Model extends CI_Model {}
class ModelBasic extends MY_Model {
// Your code here
}
// Define more than one if you want.
class ModelComplicated extends MY_Model {
// Your code here
}
Other options include:
Extend the Loader class, and replace the model() method with your own modified version. This could be complicated (I haven't explored it fully), since the actual error is occurring in system/core/Common.php :: load_class(), which, in the model's example, is instantiating the base CI_Model class, as well as MY_Model if it finds one (which it automatically looks for by default, like other base classes).
Create / Add an autoloader that follows your own rules for loading core classes (may be complicated if you try to autoload more than just models -- really depends on how you want to set your app up).
Extend the Loader class and re-write that part of the code.

Joomla and DOMPDF integration errors

I'm trying to integrate DOMPDF to our Joomla (Version 1.5.24) project and I keep getting these errors:
Strict standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 162
Strict standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\proj\libraries\loader.php on line 139
Fatal error: Class 'DOMPDF' not found in C:\xampp\htdocs\proj\components\com_reports\views\details\view.pdf.php on line 23
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 84
Strict standards: Non-static method JTable::getInstance() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\session\storage\database.php on line 89
Strict standards: Non-static method JFactory::getDBO() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\oasis\libraries\joomla\database\table.php on line 112
The function that instantiates the DOMPDF object is located in one of the views of the component:
class ReportsViewDetails extends JView{
function display($tpl = null){
global $mainframe;
//echo "hello";
$this->generatePDF();
}
function generatePDF(){
require_once("./components/com_reports/helper/dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
}
}
It sees the file that is required but dompdf_config.inc.php outputs errors described above. I'm not sure what is causing this since the file only contains define lines and an autoload function. The content of the file can be seen here: http://code.google.com/p/dompdf/source/browse/trunk/dompdf/dompdf_config.inc.php.
Please help! Thanks!
all those strict standard warnings you are getting is becuase of this line
error_reporting(E_STRICT | E_ALL);
in dompdf_config.inc.php
and you should include dompdf/include/dompdf.cls.php

Resources