How to fix bundle installation error with SSL in Ruby 3?

During bundle installation in Ruby 3, programmers are facing following error-
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed ( 10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'' succeeds before bundling.

Note: “Gemfile” located inside your project root folder.

To fix the error and make the update successful, we can use following procedure-
1. Remove secure connection
gem sources -r

2. Add insecure connection
gem sources -a

3. Update rubygems without SSL
gem update --system

4. Remove insecure connection
gem sources -r

5. Add secure connection
gem sources -a

6. Update gems
gem update

Hope this will work for all.

Yii 2 Quick Help Notes

Following basic items good to keep in notes during Yii 2 based web development.

Generating link:
    <?=  Html::a(‘Home’,  [‘site/index’],  [‘class’ => ‘class-name’])?>
Generating image link:


$logo=Html::img(\Yii::$app>request->BaseUrl . ‘/images/logo.png’,
[‘class’ =>’img-responsive’,
‘title’=>’Company logo’

echo Html::a($logo,
[‘class’ =>’class-name’]);

Hiding input field label name:

<?= $form->field($model, 'sample_text')->textArea()->label(false) ?>

Add custom layout in controller function:

$this->layout = ‘new-layout’;

Work with verb filter:

In controller header, add following:

use yii\filters\VerbFilter;

Inside behavior function add following:

public function behaviors()
return [
‘verbs’ => [
‘class’ => VerbFilter::className(),
‘actions’ => [
//’logout’ => [‘post’],   Note: Here, you can declare verb name for any specific function. But if you already declared in view file using i.e. echo Html::a(‘Logout’,

                        [‘site/logout’], [‘data-method’ => ‘post’]); then you don’t need to mention the verb name again here. If you do then it will display error message.

Add icon before href title name:

<?= Html::a(‘<i class=”glyphicon glyphicon-dashboard d-icon”></i>’ . ‘ Admin Dashboard’, [‘site/admin-dashboard’]) ?>

Render any view file from  view:

<?= Yii::$app->view->renderFile(‘@app/views/site/_admin-view.php’); ?>


……more coming……