I'm working in Windows 10 on a rails project and want to open up the devise gem to have a look. I'm running bundle open devise, which gives me the following
C:\Users\MyName\Documents\MyRailsProj>bundle open devise
Could not run 'C:Program FilesMicrosoft VS CodeCode.exe C:/Ruby22/lib/ruby/gems/2.2.0/gems/devise-4.4.1'
I've set the environment variable EDITOR to C:\Program Files\Microsoft VS Code\Code.exe in my system, which is the correct location of VS Code on my system. I've also tried setting it to point to sublime3, which has the same result.
I'm guessing I've just set this variable incorrectly, but I don't know how bundle open expects the EDITOR or BUNDLER_EDITOR to be set other than to the path of the program I want to use to open the gem. Any ideas why I can't open the gem?
edit:
I can totally just use bundle show devise so see the gem's location and go find and open it in vs code all I want, but I do also want to know how to use the EDITOR environment variable properly, so I think the question still has merit if anyone has any ideas.
It looks like bundle is treating the environment variable as an escaped string, and so all the path separators are being lost. In addition, it also might not be handling spaces correctly.
However, you might not need the path at all.
If you can open the editor just by typing "Code" at a command prompt, just set EDITOR to
code
Otherwise, instead of setting it to
C:\Program Files\Microsoft VS Code\Code.exe
try
C:\\Program\ Files\\Microsoft\ VS\ Code\\Code.exe
or
"C:/Program Files/Microsoft VS Code/Code.exe"
Related
I have some forms I have created in a local directory D:\PsToolBox. I added them to the repository, now when I inherit from them the IDE adds the Base form to the project's file, no problem. I get :
PsListView in 'D:\PsToolbox\Source\View\PsListView.pas' {frmPsList},
Unit4 in 'Unit4.pas' {frmPsList4};
However I code on 2 different computers through version control on BitBucket. The PsToolBox directory is in different locations so I need a common path in the project file.
I tried creating an environment variable PsToolBox with the path D:\ToolBox on the first machine and then editing the dpr file path of the base form to
PsListView in '${PsToolbox}\Source\View\PsListView.pas' {frmPsList},
This compiles and runs, however if I try to edit my form I get an error that the system cannot find the file. Also moving between projects in the group triggers the error as well. Closing and reopen same result.
I tried adding the environment path
$(PsToolbox)\Source\View
to both the Tools/Options/Langauge/Delphi/Library Windows32 platform, as well as the project search path. No Joy.
What am I missing? Is this even possible?
how to configure better errors for ROR on linux with firefox. Better errors gem is useful to open rails application error file with line number from browser only, so it will be less time consuming for developer to correct the error and no need to search file and line separately
First of all download and install sublime url handler patch to handle the url with line number. Download sublime-url-handler.
Goto to development.rb file and add BetterErrors.editor = :sublime
Goto firefox and type about:config in url and hit enter
Right click and create new property with boolean type with name " network.protocol-handler.expose.subl" set "False".
Restart firefox.
Run your rails app and get the error link page, click on error link it will ask open open with if sublime-url-hanlder is shown here well done choose and cheers if not shown than give your sublime executable path here and done.
Remember give sublime executable path only not /usr/bin/subl, or shared lib path. You can find the executable path by running subl and see the process details like "ps -eaf | grep subl" copy the path and give this path in firefox choose application.
I don't know why my system is only detecting environment variable of system and not user.
For instance, when I put "C:\Program Files\Java\jdk1.8.0_25\bin" as first environment variable in user environment variable , I was not able to run "javac" command.
But when I pasted it to system variable it started working.
I know about the dependency issues if I would have placed the path in user variable at the end so I put it at the beginning but still it didn't work..
I searched but found no real solution except dependency issue if I put it at the end.
Have you restarted the CMD?
Maybe you have to logoff & logon to refresh the user variables.
It least on my Windows 7 I have the same behavior, new user variable is not available.
I'm using a command process in another program that for some odd reason does not have the system32 set in the path environment variable. I can use the %comspec% variable to get the path C:/windows/system32/cmd.exe, but I need to just have the folder by itself.
I am not overly familiar with command prompt programming; is there a way that I can just add the system32 (or equivalent) path programmatically?
What do you mean programmatically? If you're refering to a variable, there is no standard variable for system32. However you could use %WINDIR%\system32 or %systemroot%\system32.
While it appears that there is no environment variable for obtaining the system32 folder (or its equivalent) on a system, I did find a solution involving string manipulation. The following block of code will add the folder where the cmd.exe path is located:
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%
It is very nice answer. i have tried and worked out. This problem comes with window7 OS probably.
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%
I switched from netbeans to emacs and I am pretty happy with the change. The thing I am missing the most is autocompletion and jump to definitions. In order to get this I have installed Rsense. It works fine for the gems code, though, I cannot jump-to-definitions of my Rails project nor autocomplete according to the methods I defined.
I tried to add my project's load path to Rsense's load_path configuration, though, it still doesn't work.
Does anyone know how to get this working?
You can use tags for browsing through files and jumping directly to function definitions.
I use Exuberant Ctags (its got Ruby support). You can download it from here.
I am assuming that you are working on windows. Getting the tags to work initially on windows is a pain especially if you are using emacs for the first time.
These are the steps I followed:
Install Cygwin from here.
Include the cygwin\bin\ folder in your environment variable PATH. E.g. here
Install exhuberant ctags. Note that emacs may sometime have a built in ctags. Later on you will have to use the ctags command in cygwin to create tags. At that time you may encounter some errors in case it uses the ctags in emacs instead of exuberant ctag.
Once you have installed ctags, add that to the environmental variable PATH as well.
If you have a small project with relatively lesser number of files (<500). So you just need a single global TAGS file. For that open cygwin, change your directory to the root directory of your project and type in the command ctags -R -e Check this out for other approaches
Your tags file will be created. It will be named "TAGS" and will be present in the root directory of your project.
Next open emacs, and browse through the code. In case you come across a function and want to jump to its definition, put your cursor on the function name and press M-. your minibuffer should then show something like Find tag (default <function-name>): Press Enter and voila!!! you are magically transported to the function definition!!!
Note: You may have to specify the TAGS file the first time you use the M-. This needs to be done only once after emacs startup. You can also modify your .emacs file to take in the TAGS file automatically on startup.
Refer to this and this for more info for tags related commands in emacs.
Until now, I have been using rtags to jump to definitions. It's not perfect, but it does the trick in many cases.