Whenever I run a script in Spyder, it automatically saves my file. How can I prevent this from happening?. I had an older version that never done this before.
There is an option Save all files before running script in the preferences. You will need to go to Preferences > Editor > Run code and uncheck the option:
Related
I am trying to run the following command on my Rails app on my Windows 10 machine:
rails credentials:edit
But I get the following error message:
No $EDITOR to open file in. Assign one like this:
EDITOR="mate --wait" bin/rails credentials:edit
For editors that fork and exit immediately, it's important to pass a
wait flag, otherwise the credentials will be saved immediately with no
chance to edit.
I did some research, and I understand that most people who want to run such aforementioned command on Windows 10 will need to install a Linux Subsystem on their Windows machines. However, such option is not available for me because I don't have admin rights on my machine. I have attempted installing a Linux subsystem by using resources like the one here without luck.
I'm using VS Code and Powershell within VS Code, and this works for me:
> $env:EDITOR="code --wait"
> rails credentials:edit
Credit goes to this article https://flexpoint.tech/2020/05/16/editing-rails-6-0-credentials-on-windows/ by J. Pablo Fernández
I didn't find any of the answers above worked for me. Notepad complained about the directory being incorrect and gave me a blank file.
I got it to work with Notepad++ by doing the following:
SET EDITOR="C:\Program Files\Notepad++\notepad++.exe"
rails credentials:edit
I didn't need to use the --wait flag.
I would suggest you switch to non-windows based system if you're trying to do any rails development as I used to work on a windows machine until I caved in and switched entirely to Mate Linux. It would be so much easier to develop Rails application on Linux platform since you would see almost all gems compiling without any issue and all the rails terminal commands are working without further setup.
However, if you would like to edit your credentials, you need a text editor (Usually vim on Linux) setup before running credentials:edit.
First run SET EDITOR="notepad_path" and then try running rails credentials:edit
You can change notepad_path to any other text editor you prefer. However, some editors like Atom was giving weird issues for me.
find your pathing to your local text editor (for windows its Notepad) you can search notepad and right-click and open the file location
right-click notepad and open properties then copy the Target:(EX.( "%windir%\system32\notepad.exe"))
now paste the target in SET EDITOR="target_path"
EX. SET EDITOR="%windir%\system32\notepad.exe"
now you can run bundle exec rails credentials:edit and notepad should come up with the decrypted info
If you are in a Windows environment, I highly recommend to use the classic notepad. In my experience using Notepad++, sometimes it opened correctly but didn't save, instead it works perfect with the classic notepad.
Also to run those mentioned commands, better use the classic cmd shell console, it might not work properly in PS (Power Shell) console. Good luck!
No $EDITOR to open file in. Assign one like this:
EDITOR="mate --wait" bin/rails credentials:edit
For editors that fork and exit immediately, it's important to pass a wait flag,
otherwise the credentials will be saved immediately with no chance to edit.
solution:
$env:EDITOR="notepad"
rails credentials:edit
I'm using windows 10 and here are the steps that I took:
make sure you have the path of your text editor in environment variables PATH
to do that, copy the file location of your text editor
right click on my computer(This PC) > select properties > advanced system settings > environment variables
on System variable box, click for "Path" > click edit > new > paste text editor file location
restart command line then try to open text editor using the command line. I'm using sublime and entering "subl" will open sublime text editor
cd to your project folder then run the following command:
set EDITOR=subl --wait
where subl is the executable file of the text editor
also without double or single quote, this will work since subl is an executable file and was registered on environment variable (if using notepad use: notepad).
Without the --wait flag, your credentials.yml.enc will be saved immediately without giving you the chance to edit.
alternatively you can directly set EDITOR similar to this:
set EDITOR="C:\filepath\to\your\editor --wait"
this time with quotes
Finally run:
rails credentials:edit
[Windows 8.1]
I'm using SET EDITOR="C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst -notabbar -nosession -noPlugin command to set the editor and it works.
Next, just run rails credentials:edit command. Then you can edit the credentials.yml file. Save it and close the Notepad++ windows. Then the credentials is encrypted and saved automatically.
Got it working (using PowerShell) with
$env:EDITOR="notepad"
then
bundle exec rails credentials:edit
I just follow https://www.dartlang.org/docs/dart-up-and-running/ch01.html to run a Dart console application,but the result is ‘HTML file could not be found’.
If you want to know how to start it from DartEditor, just right-click the file in the Files view and choose Run. If you click the Run button in the toolbar, probably the previously launched file is launched (didn't use DartEditor since 1/2 year)
If you want to launch it from command line just run dart bin/main.dart
Is there a procedure I can follow that includes running a script in the terminal, to delete all the files under the derived data folder and reliably clean a project?
Sometimes, a project's assets don't always get updated to my simulator or device. It's mostly trial and error, and when I find that an old asset made its way into a test build, it's too late, not to mention embarrassing!
I've looked at this question, but it seems a little outdated:
How to Empty Caches and Clean All Targets Xcode 4
I also checked out this question, but I don't want to waste time in Organizer, if I don't absolutely need to: How to "Delete derived data" in Xcode6?
I've looked at other posts out there, but found nothing that solves the problem of reliably cleaning a project and saves time with a script.
It's basically a two-or-three-step process, which cleans the project of all cached assets.
Of course, if anyone uses this technique, and a project still does not show updated assets, then please add an answer! It’s definitely possible that someone out there has encountered situations that require a step that I’m not including.
Clean your project with Shift-Cmd-K
Delete derived data by calling a shell script (details below), defined in your bash profile
Uninstall the App from the Simulator or device.
For certain types of assets, you may also have to reset the Simulator (under the iOS Simulator menu)
To call the shell script below, simply enter enter the function name (in this case 'ddd') into your terminal, assuming it's in your bash profile. Once you've saved your bash profile, don't forget to update your terminal's environment if you kept it open, with the source command:
source ~/.bash_profile
ddd() {
#Save the starting dir
startingDir=$PWD
#Go to the derivedData
cd ~/Library/Developer/Xcode/DerivedData
#Sometimes, 1 file remains, so loop until no files remain
numRemainingFiles=1
while [ $numRemainingFiles -gt 0 ]; do
#Delete the files, recursively
rm -rf *
#Update file count
numRemainingFiles=`ls | wc -l`
done
echo Done
#Go back to starting dir
cd $startingDir
}
I hope that helps, happy coding!
Another way to delete derived data in Xcode is just by deleting the Derived Data folder.
Here is a visual tutorial of how you can do that easily without using command line: https://www.youtube.com/watch?v=ueEMGXKDBAc
I installed NetBeans 7.3.1 onto my mac and then proceeded to download the necessary Ruby plugin to allow for Ruby in the IDE. However when I go to add the plugin file I get this message:
Unable to connect to the ruby because of Unexpected closed connection to file:/Users/XXXXX/Desktop/updates
Check your proxy settings or try again later. The server may be unavailable at the moment. You may also want to make sure that your firewall is not blocking network traffic.
Help is appreciated! Thank you!
This post might help you. https://blogs.oracle.com/geertjan/entry/ruby_on_rails_in_netbeans
Go to "Tools > Plugins",
Select "Downloaded" tab
Click on "Add Plugins ..."
Navigate to your updates folder
Select only the *.nbm files
in addition to picking the .nbm files from the unzipped folder, the .jar file must also be added to the plugin selection for the plugin to install. You can use the 'show all files' drop down menu option in the selection dialog box to add the .jar file to the included file list.
I want to specify a project to be opened when I launch Delphi(D2010).
Is there a command-line parameter to pass to bds.exe, like the -r option allowing to load a specific Registry Setting, where I could pass the name of the project I want to open when launching bds.exe?
The only options I know of are:
-ns "no splash"
-np "no project"
-hm "Heap Monitor"
-attach "attach to process(JIT)"
-r "registry root"
-p "Personalities"
Just add the path after your command.
"{path to rad studio}\bin\bds.exe" -pDelphi "C:\Projects\TestProj\TestProj.dproj"
BTW: here is the IDE Command Line Reference.
Sounds to me that instead of launching Delphi, you should just double-click the project file. The OS will start Delphi for you, and Delphi will open the project automatically. Make a shortcut to it on your desktop or in your Start menu for easy access.
In Delphi 7 and earlier, use the DPR file. For later versions, use the DPROJ or BDSPROJ file instead.
Works for project groups, too.