Compiling and Serving Assets (JavaScript/CSS) in Production Environment -Rails 6

In order to server assets in Production environment; assets are first compiled and put into /public/assets directory. So, first you need to run the following command to compile the assets.

RAILS_ENV=production rails assets:precompile

It is encouraged to serve static content using NGINX/Apache. But if you want rails to serve the contents add/modify the following line on production.rb

config.public_file_server.enabled = true

In case you are facing anomaly and confident your code is correct then try clearing the cache using

rails tmp:cache:clear

 151 total views

Ruby Method for encoding Bangla Unicode Text to Hex Value to Send Bangla SMS using SSLWireless

The following ruby method converts an Bengali Text to Hex value.

def encode_for_bangla_sms( text )

text_bangla = "১ ২ ৩, ১ ২ ৩ "
text_encoded = encode_for_bangla_sms text_bangla

SSLWireless providers a different stakeholder id for Bangla SMS. So if you use that along with the hex value, you should receive the Bangla text.

 50 total views

Adding Ruby SDK to RubyMine from rbenv wsl

Run the following to get the ruby bin path

rbenv which ruby

You should get a path like the following


Now on RubyMine type Alt + Ctl + S to open settings and search for ‘sdk’. Under Languages & Frameworks you will find Ruby SDK and GEM; select it. Now click on the + icon and select ‘New Remote’. Now Select WSL, choose the linux invironment and paste the link we copied earlier. Now your SDK should be added to RubyMine.

 34 total views