You recently installed rails but since you're still learning, you did a lot of stuffs. One day, you got the following error: 1~$ rails --version 2Traceback (most recent call last): 32: from /usr/local/bin/rails:23:in `<main>' 41: from /usr/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path' …
Read MoreIf you no longer wish to use RVM, you can uninstall it by first removing the script calls in your .bashrc file and then removing the RVM files. First, remove the script calls with a text editor like nano: 1~$ nano ~/.bashrc Scroll down to where you see the RVM lines of your ~/.bashrc file: 1... 2# Add RVM to PATH for …
Read MoreGems Ruby applications or libraries. In Rails, you install gems so you would write less code. Creating Gemset To make it easy to manage, create gemset. Think of it as a group of libraries that you can switch to depending on situation. 1~$ rvm gemset list 23gemsets for ruby-2.7.0 (found in …
Read MoreFor instance, we want to create a blog in rails, use the command: 1~$ rails new blog Start the server 1~$ cd blog 2~$ bin/rails server Access it in http://127.0.0.1:3000. See details in this link
Read MoreYes, there's a fully opensourced version of docker and it's called podman. It can be installed in other OS but what I'm showing is in WSL/Ubuntu. 1~$sudo apt install podman It's actually a drop-in replacement for Docker. See details in this article.
Read MoreDo the Migration 1python3 manage.py makemigrations 2python3 manage.py migrate Create the Admin Account 1python3 manage.py createsuperuser Run server 1python3 manage.py runserver Visit http://127.0.0.1:8000/admin and use the account created earlier.
Read MoreCode Let's call it first.pl 1~$ nl -ba first.pl 21 #!/usr/bin/env perl 32 43 use strict; # important pragma 54 use warnings; # important pragma 65 76 print "What is your username? "; # print out the question 87 my $username = <STDIN>; # ask for username 98 chomp($username); # remove “new line” 109 print …
Read MoreBy now, you should now have a basic django skeleton site as shown in Starting Django. Here's how you create a basic site that now says "Hello World" Create the App Inside your basic skeleton site, run the command: 1~$ python3 manage.py startapp myapp Server file structure of current directory would now be as …
Read MoreIt is typyically as follows: 1+- Hello-World <-- Project Root 2| | 3| +-- db.sqlite3 <-- Database 4| +-- manage.py <-- Management Tool 5| +-- myapp/ <-- Custom App 6| +-- forum/ <-- Custom App 7| +-- myadmin/ <-- Custom App 8| +-- mysite/ <-- Project Package 9| 10+- venv <-- virtual environment …
Read More