Gallery just showing plain short code like [gallery ids="240,236,275"]. how to solve this?

Please check that the shortcode you have added in content is proper, check that you might have miss any thing in it.

If your shortcode is ok then it seems that post content is loaded as it is without applying shortcodes. So you need to apply do_shortcode() function for content.

Please add following code in your theme’s function.php file.

add_filter( 'the_content', 'apply_short_code' );

function apply_short_code( $content ) {

    if ( is_single() && in_the_loop() && is_main_query() ) { // add this condition if you want to apply this for selected pages only.
        return do_shortcode($content) .
    }

   return $content;
}

If you have added shortcode in custom fields(other than default content section), you need to apply do_shortcode funtion before you print the value of that field.

Hope this will help you.