There is a lot to consider to gain weight/muscles whether you are a diabetic or not. Your top priority is to have stable blood sugar levels, don't ever compromise that over anything else.
Then comes your diet and your type of training. You have to be in a calorie surplus but most importantly having decent macronutrients in your diet.
You need to do exercises that will help you gain muscles and strength such as bodybuilding, weightlifting, powerlifting workouts etc. Not running or cycling for example as this will aid in burning calories more than building muscle fibres.
Hope that helps.