Problems using Rubymine with WSL - ruby

I created a debian WSL. I installed Ruby and Rails and all the necessary stuff to make the rails server run.
Now I want to edit my code with Rubymine. What is the best way to accomplish my goal?
Do I have to prepare path mapping and keep the files in sync? Or is there a better way like directly editing the code in debian file system?
Thanks for your help

Under wsl you can access the windows filesystem via mount point. C: is under /mnt/c . So you could write your sourcecode with any windows-editor you like, but only in the windows filesystem. If you wonna start your rails app, go to the directory in the wsl: /mnt/c/Users/oliver/myrailsapp/

Related

How to run RediSearch module with Redis on WSL (Windows Subsystem for Linux)

I followed the steps on https://redislabs.com/blog/redis-on-windows-10/ and have installed Ubuntu 18.04 and am successfully running Redis v4.09 on Windows. But, when following the steps on https://oss.redislabs.com/redisearch/Quick_Start/, I have some issues.
In the download and running binaries section, I don't understand what I'm supposed to replace /path/to/module/src/redisearch.so with. I've downloaded RediSearch for Ubuntu 18.04 and I've moved the files to a folder named RediSearch within my Downloads folder. Could someone help me with the pathing considering I'm using Ubuntu on Windows? I've also tried it with Building and Running with Source section but that just runs into an error every time I run make:
*** No rule to make target 'build'. Stop.
How can I run the module with Redis?
With WSL, you have access to C: through /mnt/c/ from Linux.
So, if you really want to have redisearch on a folder in Downloads you need to use something like:
/mnt/c/Users/<yourUser>/Downloads/yourFolder/src/redisearch.so
However, you probably should use a folder within Linux instead. You can use wget to download from Linux.

Command not found in bas

I'm so sorry because I know this is a dumb question, but I've been trying to figure this out for about 2 hours and I can't figure it out. I've created a bash file that uses some other programs (tcpdump, tshark). The bash runs as it should but on every line that I use tshark, tcpdump, etc. it says "command not found".
I'm using Cygwin on my Windows 7 VM. All of the files are in the same folder and I I've tried adding the locations of the other programs to the PATH variable. I tried commands such as export PATH=$PATH:filelocation but when I do $PATH those results aren't showing. How can I get these commands to be recognized?
Thank you.
current errors
Cygwin is not a Linux distro, therefore, you don't have all the functionality like you would if you had a Linux installation.
You could try one of the following.
1) Use Virtualbox to make a VM of some Linux distro and use bash there. You could use Ubuntu server, which has no GUI.
2) Use this site to find packages that will add functionality to Cygwin.
3)Upgrade to Windows 10 and have a native (sort of) bash to use.

How to open gnuplot from mobaxterm?

I'm not sure how to open Gnuplot from MobaXterm. I've been trying many different commands but they all don't work. When I try, I get the same error.
-bash: gnuplot: command not found
I'm curious if I downloaded Gnuplot to the wrong part of the computer or if I'm not getting the command right? I'm trying to write a program in shell script that opens Gnuplot on it's own and plots data through the shell script.
Any help is appreciated!
mobaxterm is not a linux server. So you cant install packages into it normally.
you must download plugins if you can find the plugin you are looking for
check their list here
http://mobaxterm.mobatek.net/plugins.html
and it seems gnuplot is not there .
in this case your easiest solution is to download cygwin and add gnuplot on it which is possible
other option is to run small virtual machine so you can test on it
in all cases mobaxterm is not real linux enviroment so to be sure your shel do work on normal linux machines you will need to develop and test on real linux
You can install the winbuild of gnuplot and add the path to the bin directory, with gnuplot.exe in it, to mobaxterm's PATH (probably set it in .initrc or .bashrc, whichever you prefer).
MobaXterm is a standalone program which 'emulates' a Linux terminal but has no idea about your frame system (e.g. your Windows and your programs). So if you type 'gnuplot' Moba has no idea what is this. You have to
change the current directory to where is wgnuplot.exe e.g.:
cd /drives/c/Program\ Files/gnuplot-4/bin
./wgnuplot.exe
or run directly it:
/drives/c/Program\ Files/gnuplot-4/bin/wgnuplot.exe
or change your $PATH:
PATH=$PATH:/drives/c/Program\ Files/gnuplot-4/bin
wgnuplot.exe
or create a script named 'gnuplot' which runs wgnuplot.exe
#File name: 'gnuplot'
#!/bin/sh
/drives/c/Program\ Files/gnuplot-4/bin/wgnuplot.exe
and place it into some $PATH directory:
`/bin` or `/usr/bin` or `/drives/c/WINDOWS` or `/drives/c/WINDOWS/system32`
or... :)
The simplest way I found out is to use the Moba Package Manager to install the win version of gnuplot.
Open MobaXterm and type MobApt. An GUI will open up and you can type in "gnuplot" in the filter field.
Just select and install the package, MobApt will take care of any dependencies for you.

Unable to create vagrant file (homestead.yaml) on windows

I'm gonna to use vagrant on my windows desktop to develop Laravel project. I have followed all the steps to do that. But it has been failed to create homestead.yaml using bash init.sh command.
Below is the error :
Fakhreddin#Lenovo-PC3 /cygdrive/d/laravel-vagrant/homestead
$ bash init.sh
cp: unwritable ‘/home/Fakhreddin/.homestead/Homestead.yaml’ (mode 0500, r-x------); try anyway?
I'm using Cygwin for simulating Unix terminal in the Windows.
(Copy of the comment I wrote above)
Never used Cygwin in my life, but what I would try is to run it as Administrator and re-try.
Otherwise, you may want to consider changing console client. For example, if you install Git, you should be able to use Unix commands via standard Windows console.
I would seriously point the fault at Cygwin, or its settings. I am a member of a team in which all of us run Homestead on Windows 7, with no problems at all. The difference is, we use native Windows command line.

How do I run a Ruby script remotely on Linux machine

I am connected to a Linux server from my Windows machine using putty. I need to create a ruby file and execute the same. Should I create the Ruby file on my machine or on Linux server? Please advise.
Best workflow in this case would be to write the rb script in whatever environment you want ... many people like developing locally on their own machine (which has advantages), and many prefer developing it remotely on another machine.
Basically write it the same way as you would write any ruby file on your favorite text editor using your favorite method.
Then you upload the rile to the remote machine -- you can use software like WinSCP and then run the script using ssh:
$ ssh (server address)
$ ruby (path to wherever you put the script)
It doesn't matter where you compose the script.
You can either compose it locally or remotely
When you're composing it localy you can do it with your well known GUI-Editor Tools like Notepad or so, but you'll have to upload the file to the server to use it there.
When you're composing it remotely you'll have to use CLI-Editors like nano or ViM for it, but you're able to run it instantly without uploading it
And you can run the script on the remote machine as usual
$ ruby path/to/you/script.rb
assuming ruby is already installed
If you want to execute the ruby file on server you have to create it on the server.

Resources