Switching Programming Languages


#1

I haven’t found this answered in the literature and I’ve been searching for over an hour so I’ll ask**: How would one switch from python to ruby or any other language?**
For example: I have been using atom to code in python and python shows up in the bottom left corner of the screen. When i use the F5 keybinding I get an error

PT_disemvoell.rb is not a .py file, exit.

All I want to do is run code in ruby, I have the package language-ruby installed and I can’t for the life of me click on python (bottom left) and get rid of it or click the ruby(bottom right) and activate it. Can someone point me in the right direction?


#2

What command is F5 bound to for you? This sounds like some community package that you have installed. Also, “clicking in the bottom left corner of the screen” on my copy of Atom has nothing to do with the language of the file, that just copies the path of the file to the clipboard:

Clicking in the bottom right (depending on what community packages you have installed) generally activate the grammar-selector package. You can find out more information about it in the Atom Flight Manual:

http://flight-manual.atom.io/using-atom/sections/grammar/


#3

Thanks so much for giving me some more places to look. so the grammar selector is on the right and detects ruby. on the left in the orange circle is a possible clue. When I hover over python it says " current build target is python" clicking on that other the ruby on right in red does bring up the grammar selector

. It may indeed have to do with packages installed. I have popular python run packages that likely created the F5 keybinding to RUN in the cmd. called Atom-python-run version 0.6.2 that may be interfering with this. I disable it and my F5 keybinding goes away and i’m not versed enough to have set up my own keybinding yet… I guess i’d better do that. Is there anything I missed besides that?


#4

No, it sounds like you’re on the right track. It sounds though like the atom-python-run package isn’t going to be able to help you run Ruby code though :grinning:


#5

Seems ultra silly to have to disable packages to switch from python to ruby. As I expand, we move past ultra silly. After 4 hours of searching i’m pulling my hair out. I’ve set the path on my win7 machine in environment variables… C:\Users\J-BOOG\AppData\Local\atom\bin

and all… i’m… looking. to do is tie ruby RUN command to the command prompt. Can you help me figure out why this is so difficult? Atom runner isn’t working for me…


#6

I agree, you shouldn’t have to disable packages to switch from Python to Ruby. But Atom doesn’t make you do that even if that specific community package does. If it is true that community package gets in the way of you working with Ruby, I would file a bug on that package or choose a different package.

I’m not the best person to help with executing code through Atom, I do command prompt stuff outside of Atom at the command prompt ¯\_(ツ)_/¯ Perhaps someone else here has some ideas though.


#7

Hey I really appreciate you lending some support regardless- Thanks a lot!
I was typing as you popped back in so i’ll just continue I guess!
while using the script package and hitting control-shift-b I get the error “‘ruby’ is not recognized as an internal or external command, operable program or batch file.”


#8

What that means is that ruby is not on your PATH (or at least the PATH that Atom was started with). You may want to see if the script package has a way to add to the PATH when you run a script.

And you’re welcome :grinning:


#9

New error! C:/Users/J-BOOG/Documents/learn ruby/disemvowel.rb:8:in <main>': undefined methoddisemvowel’ for main:Object (NoMethodError)
[Finished in 0.639s]

user variable in PATH: C:\Ruby22\bin;C:\Users\J-BOOG\AppData\Local\atom\bin;C:\Python27

seems about right eh? also- how did i get so lucky as to have your help? :heart_eyes:


#10

I managed to get this working for python… weird!