I have a problem when you install Kohana.
I removed the install.php file, I then printed the error
Kohana_HTTP_Exception [ 404 ]: Unable to find a route to match the URI: kohana-3.3.3.1
SYSPATH/classes/Kohana/Request.php [ 986 ]
It is possible you don't have any routes defined, that case see the guide
Otherwise you may need to have a catch all route like the one below:
// catch all route
Route::set('catch-all', '<any>', array('any' => '.*'))
->defaults(array(
'controller' => 'my_controller',
'action' => 'catchall',
));
Related
Am getting the above error in console on loading my application. My controller looks as below.Am new to angular so any help would be appreciated
Am trying to export the datatable into excel here. I think the issue is here angular.module('myApp','datatables', 'datatables.buttons'])
What is the correct way to include them in the module?
ViewCtrl.js
angular.module('myApp',['datatables', 'datatables.buttons'])
.controller('ViewCtrl', function($scope, DTOptionsBuilder, DTColumnDefBuilder) {
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withPaginationType('full_numbers')
.withDisplayLength(2)
.withDOM('pitrfl')
.withButtons([{
extend: 'excelHtml5',
}
]);
vm.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0),
DTColumnDefBuilder.newColumnDef(1).notVisible(),
DTColumnDefBuilder.newColumnDef(2).notSortable()
];
});
Verify the console loads. If the console.log does not show and you still get the inject error, then your problem is likely the datatables and datatables.buttons. Verify that these files are added to your index.html file prior to this file.
angular.module('myApp', ['datatables', 'datatables.buttons'])
.controller('ViewCtrl', function ($scope) {
console.log("Code of awesomeness");
});
If you find that you do see the console.log("Code of awesomeness"); Then your $inject issue is DTOptionsBuilder, DTColumnDefBuilder. Verify spelling.
I was trying to create a new file in my module, but every time I am getting an error for my file resource, saying:
File paths must be fully qualified, not '/the/path/that/I/have/given'.
What are the possible reasons for that error?
class fresh_start {
file { 'source_file.rb':
ensure => 'file',
source => 'puppet:///modules/fresh_start/source_file.rb',
path => '/etc/puppetlabs/code/environments/production/modules/fresh_start/destination_file.rb',
owner => 'root',
group => 'root',
mode => '0755', # Use 0700 if it is sensitive
notify => Exec['run_my_ruby']
}
exec { 'run_my_ruby':
command => 'ruby etc/puppetlabs/code/environments/production/modules/fresh_start/source_file.rb > /etc/puppetlabs/code/environments/production/modules/fresh_start/output.txt',
refreshonly => true,
}
}
I have also tried to put the file path in a variable and use that variable as the path attribute's value, but I got the same error.
This happens when you attempt to run code with Unix paths on Windows. Check out the Puppet source code here and here.
Using a debugger, we can see that Unix-style paths are rejected on a Windows platform:
[1] pry(main)> slash = '[\\\\/]'
=> "[\\\\/]"
[2] pry(main)> label = '[^\\\\/]+'
=> "[^\\\\/]+"
[3] pry(main)> AbsolutePathWindows = %r!^(?:(?:[A-Z]:#{slash})|(?:#{slash}#{slash}#{label}#{slash}#{label})|(?:#{slash}#{slash}\?#{slash}#{label}))!io
=> /^(?:(?:[A-Z]:[\\\/])|(?:[\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|(?:[\\\/][\\\/]\?[\\\/][^\\\/]+))/i
[4] pry(main)> path = '/foo/bar'
=> "/foo/bar"
[5] pry(main)> path =~ AbsolutePathWindows
=> nil
Trying to use puppets file_line to update /etc/environment
class system_variables {
include stdlib
file { '/etc/environment':
ensure => present
} ->
file_line { 'Add ENVIRONMENT_TYPE':
path => '/etc/environment',
line => 'ENVIRONMENT_TYPE="production"',
match => '^ENVIRONMENT_TYPE'
}
}
But keep getting error:
Error: /Stage[main]/System_variables/File_line[Add ENVIRONMENT_TYPE]: Could not evaluate: Invalid parameter encoding(:encoding)
I have tried googling but to no avail.
Edit:
Ive also tested it on the master server where it runs without errors.
The file encoding is the same on both servers, and checked locales on each server aswell.
I just began to use Broadcasting with Pusher and Echo. My problem is that I'm getting an error and I can't find how to resolve it. The error message look pretty straigthfoward, but I have no idea where I should head to get rid of it.
My laravel is an upgrade from Laravel 5.3. I uncommented the App/Providers/BroadcastServiceProvider::class into config.php.
I created an event and set the Private channel.return new PrivateChannel('dealer.'$this->client->dealer_id);
I added the new channel into routes/channels.php
Broadcast::channel('dealer.{dealerId}', function ($user, $dealerId) {
return (int) $user->dealer_id === (int) $dealerId;
});
I added this to bootstrap.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: 'my-secrect-key'
});
I also added everything to the .env file. Finally, I added the channel to the script at the end of the applayout.blade.php
Echo.private(`dealer.1`)
.listen('NewClient', (e) => {
console.log(e);
});
When I load the page, this is the error I got from the console:
Pusher : Error : {
"type":"WebSocketError",
"error":{
"type":"PusherError",
"data":{
"code":null,
"message":"Auth value for subscription to private-dealer.1 is invalid: should be of format 'key:signature'"
}
}
}
What am I missing/doing wrong?
Upgrading Laravel 5.3 to 5.4 you should make changes in your .env file
Change From:
PUSHER_KEY
PUSHER_SECRET
to
PUSHER_APP_KEY
PUSHER_APP_SECRET
Someone answered it on Laracast. Link
Is there any way to have requireJS optionally (like maybe through a plugin) return null for a dependency that failed with a 404?
For example:
require(["allow404!myscript"], function(myscript){
console.info(myscript); // myscript should be null if myscript doesn't exist
});
You could abuse paths config fallbacks to achieve this:
require(["myModuleOrNull"], function(myModuleOrNull) {
console.log(myModuleOrNull);
});
in your requirejs config:
paths: {
'myModuleOrNull': [
'unreliable-module-location',
// If above fails (timeout, 404, etc.) use the one below
'null-module'
]
}
and the null-module.js:
define([], function() {
return null;
});
...but why would you want to do that? Handling optional null where a module is expected will be nothing but pain. Is there some specific reason for doing this?