Internal Server Error when running running yajra datatable using php artisan serve - yajra-datatable

I'm new in Laravel and I would like to ask for guidance for the datatables tutorial.
I tried to follow the laravel datatables tutorial from the link I provided below and I kept on encountering the issue below.
Laravel Datatables Link:
https://appdividend.com/2018/04/16/laravel-datatables-tutorial-with-example/
DataTables warning: table id=table – Ajax error. For more information about this error, please see http://datatables.net/tn/7
I tried to change the providers and aliases from the config as instructed. I also went to the Web Developer > Network by clicking ctrl+shift+E in firefox, I went to xhr and I saw that its returning 500 Internal Server Error. Could you please guide me on how to fix this.
I am using php artisan serve to run the web page as instructed on the tutorial but according to the github link the artisan serve should be avoided.
github link: https://github.com/yajra/laravel-datatables

Related

Heroku Ruby-on-Rails app won't load, logs look fine

I am following Ruby On Rails Book Tutorial, Chapter 2, toy_app
I created repository in BitBucket, https://bitbucket.org/Marium36/toy_app/src/master/
And I am learning to deploy early and often to Heroku, https://salty-wave-17330.herokuapp.com/
On my local Ubuntu VM, I can perfectly load localhost:3000 and localhost:3000/users
On Heroku I can go to https://salty-wave-17330.herokuapp.com/
However, when I go to https://salty-wave-17330.herokuapp.com/users, I get the error:
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
The build logs look perfectly fine, https://bitbucket.org/Marium36/toy_app/src/master/build
What can be the problem?
Two things you can do:
First: Check your server logs (not build logs), this will most likely tell you where the problem is - https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-logs
Secondly: Add an error monitor like Airbrake - Check out Errors and Exceptions section on this page - https://elements.heroku.com/addons
Also, build logs are only related to deploying the app, you have to check the server logs to know why your server is throwing an error.

swagger.json uri mapping does not work in Silex app

I am developing a REST api using PHP and Silex and Swagger. In a local development environment I am trying to map the uri http://localhost:8888/swagger.json to the swagger spec. However, the silex routing mechanism in a local dev mode does not seem to like uri's that end with ".json". I can get this to work when I deploy the application to an http server, but not in local dev mode. Does anyone know if this is a config issue in Silex? Thanks.
In case anyone wants to refer to this later. I found a solution. To get this to work in my project, which is based on the Silex skeleton project (https://silex.symfony.com/download). The skeleton project includes web/index_dev.php. I created a task in my composer file that runs the php local/dev server for the project using that file. The task looks like this:
php -S localhost:8888 -t web /web/index_dev.php
Another solution to this problem can be found at:
https://silex.symfony.com/doc/2.0/web_servers.html#php-5-4
Look near the bottom of the page for the "PHP" section.

Liquid error when trying to embed twitter feed on GitHub Jekyll page using plugin

I am trying to embed my twitter timeline on my Jekyll Blog hosted on Github.
This is the plugin I am trying to install: https://github.com/rob-murray/jekyll-twitter-plugin
These are instructions I am using to install plugins in general: https://jekyllrb.com/docs/plugins/
The site above includes the warning:
Plugins on GitHub Pages
GitHub Pages is powered by Jekyll. However, all Pages sites are generated using the --safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.
You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files."
Does this mean what I am trying to do is impossible, without building the site statically, since I am using Github pages? I am lead to believe not, because I encounter an error even when serving the site locally on my laptop.
However, I get the following error when I place the example {% twitter https://twitter.com/jekyllrb maxwidth=500 limit=5 %} into my index.md file. When I do jekyll serve --watch locally, it gives the error:
Liquid Exception: Liquid syntax error (line 7): Unknown tag 'twitter' in index.md
I do not know if the error is in my installing of the jekyll-twitter-plugin, or in the way I am using. For reference, to install the plug I did the following:
put jekyll-twitter-plugin in my _config.yml file under the gems: header
put gem 'jekyll-twitter-plugin' into my Gemfile
did sudo gem install jekyll-twitter-plugin locally on my own machine.
Can anyone help me figure out what I've done wrong?
That plugin is not supported by Github Pages, so it won't work there. The only possibility to use it is to build your site locally before pushing your site to Github Pages.
If you want to install it locally anyway, after adding the gem to Gemfile, Install the gems specified in that Gemfile:
bundle install
Then continue using the plugin tags in your posts.

How can I install Publify (Typo) on an existing site?

How can I install Publify on an existing rails app in the subdirectory /blog? I am running rails 3.2. Can anyone help? Or at least point me in the right direction? Thanks!
A similar question was asked, but never answered here.
Before following below steps you should know there will be two applications: your main application and publify application. So both should run on different ports.
Download source code from https://github.com/publify/publify. Follow the guide and run this application. It is very easy to run and install, everything is mentioned clearly. If any error you got while installation, post the error.
Run publify application to some port let us say localhost:3000
Let us say you have your main application which runs at localhost:4000
In your views just write this script which will rediret you from your main application to publify running at localhost:3000 by link_to method.
Now you can use publify.

Google Visualizations for Rails 3 - uninitialized constant ApplicationHelper::GoogleVisualization

I am using the following gem for Google Visualizations https://github.com/jeremyolliver/gvis
I have followed the instructions for installation and usage on the page but I get the following error:
uninitialized constant ApplicationHelper::GoogleVisualization
How can I correct this error? I think it may be to do with restarting the server or rails but I'm not sure how to do this
Also what is the common plugin/gem or approach to using Google Visualizations with rails 3?
EDIT: I have now restarted my server and get the same error. One thing I noticed in the installation instructions is renaming the directory:
mv vendor/plugins/rails/rails-google-visualization-plugin vendor/plugins/google_visualization
The first line has a sub directory called rails within vendor/plugins, however this is not actually created when the plugin is installed. I am not sure if this is a typo error or not in the installation instructions
It's possible that you just need to restart your server. Open the console with your Mongrel or WEBrick running, and type Ctrl+C, and when it's done exiting, type rails s.

Resources