I recently installed ruby, and now every time I open a new terminal session I can see that the environment in active (See screenshot). I have already checked my .zshrc and .bash_profile files and couldn't find anything about ruby.
Related
I just installed something through chocolatey and unable to access it through my currently open Windows Terminal. On Linux, I could do a source ~/.bashrc or something to update my $path I changed in .bashrc.
Also, opening a new tab in the same terminal doesn't update the path either. I have to close the whole Windows Terminal window (hence closing all the tabs) and reopen the Windows Terminal.
Is there a way to have the current window load the latest path (so it can be available in a new tab)? Or better yet, to update the path in the current terminal?
I have referenced this question: How do I activate a virtualenv inside PyCharm's terminal?
As it mentions, PyCharm should support auto activate virtual env since 2016. But I fail to get it work.
Above is my setting page for the PyCharm Terminal. I have checked the 'Activate virtualenv'.
But every time I start a terminal in PyCharm, it didn't automatically activate the virtual env. I need to manually use command conda activate <environment_name> to activate the environment.
I am using a Conda Environment installed with homebrew.
May I ask, is there any parameters that I can add to the Shell path (/bin/zsh) to make it automatically activate specific virtual env? Or other ways to solve this problem?
I had it working. This has nothing to do with pycharm.
My issue was about anaconda HKEY_CURRENT_USER was still there even after uninstalling it.
1-You must check your PATH environment variable echo %PATH% in the command prompt and check for paths that do not exist anymore or check for the "&" sign and remove them.
2-The following may be this works for you:
Open the Registry Editor (press the Windows key, type Regedit and hit Enter).
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun and clear the values.
Also, check HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
I have solved this problem with an alternative method found in: https://stackoverflow.com/a/55658404/15416614
Although this question is originally asking about the Windows environment and it is in 4 years ago, there is an answer from 'Ethan Yanjia Li' that can still solve my current problem.
This seems to be a PyCharm bug that the 'Activate virtualenv' option is not working sometimes. It has been fixed before but reappears in some situations, according to: https://youtrack.jetbrains.com/issue/PY-23417.
I've heard that it's best to wait after a new OS comes out until a few updates come in so that the build is a bit more stable. However, I'm also wondering if I will have to set up my environment, PATH, etc again after upgrading. Will updating change anything or will everything be the same as before?
(I'm currently on macOS Mojave 10.14.6)
One thing to note is that environment variables can live in different places, so it may depend on which ones you're referring to.
Usually if Mac OS upgrades need to change a file that you're likely to customize, like the httpd.conf file, they'll make a backup first. But there's no guarantee; it's good to keep a Time Machine backup handy from before you upgrade. With that you can copy in anything that got lost.
Also note that Catalina is switching the default shell from bash to zsh, so if you have environment variables in .bash_profile or .bashrc, those will be ignored. You can switch back to bash if you want, or configure zsh with similar settings.
Starting with macOS Catalina -- by default it takes zsh and hence you need to change in zprofile. Please follow below steps
touch ~/.zprofile; (// This will create the profile)
open ~/.zprofile; (Open this in an editor)
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home
export GRADLE_HOME=/Users/myuser/Documents/installs/gradle-6.8.3
export PATH=$PATH:/Users/myuser/Documents/installs/gradle-6.8.3/bin
source ~/.zprofile (Execute the new .zprofile by either restarting the terminal window or using this)
I use mac and rubymine 7.1.2 and I want to setup default environment variables? Is it possible to setup them up per run configuration so every test, rails generator, rails console has access to them.
Is there something like .env file or something else, so it's possible just set them once?
Jetbrains actually has a page to help you do just this:
Mac OS X applies .bash_profile and .profile only for Terminal.app environment and Apple's technical documentation suggests using ~/.MacOSX/environment.plist for other applications. So, by default PATH value will differ for RubyMine and the console.
MacOS 10.6 or later
We recommend to manage your environment variables using free
Enviroment Variables preference pane instead of environment.plist
manual editing.
MacOS < 10.6
Unfortunately, the "environment.plist" approach doesn't always work on
MacOS < 10.6, e.g if you start RubyMine from Spotlight the environment
is not applied.
Thus real solution is to set your environment variables in
/etc/launchd.conf (thanks to David Goudreau for this tip). For
detailed description please read Mac OS X Global Environment Variables
article.
So you should:
Open /etc/launchd.conf file (e.g. $sudo nano /etc/launchd.conf)
Then set correct PATH env variable
setenv PATH /Users/romeo/.gem/ruby/1.8/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/git-core:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Set other env variables for RubyMine if necessary
Save changes
Reboot
P.S: If you always launch RubyMine using Dock or QuickSilver and do
not use Spotlight you can install Enviroment Variables preference pane
and use it instead of the manual environment.plist editing.
NB: Please don't miss "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
in the end of PATH value, because PATH=...:$PATH doesn't work here.
I have installed Ruby 2.0 from
file: rubyinstaller-2.0.0-p0.exe
site: http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-2.0.0-p0.exe
I cannot get fxri to execute from the cmd prompt, within irb, within a ruby window, or by clicking on the icon within my OS explorer window. I've tried to execute fxri in these four ways by referencing the multiple fxri files throughout the Ruby folders.. the primary one being (C:\Ruby200\lib\ruby\gems\2.0.0\gems\fxri-0.3.7\fxri.rb)
I did the command load gem fxri, and a console popped up saying that it was loading the gem, then it gave me a message saying that it was successfully loaded.
I've tried typing out the full path name in the cmd prompt, irb window, and ruby window,
AND
I've tried to launch it by typing fxri after going into the environment variables settings on my OS (Vista 32 bit) and setting fxri to reference (C:\Ruby200\lib\ruby\gems\2.0.0\gems\fxri-0.3.7\fxri.rb).
None of this has worked.
I've looked inside the fxri.rb file and could not find any reference to rubyw that I could change to ruby to make it windowed instead of windowless.
I have searched for hours for references to fxri incompatibilities in a 2.0 environment and found none.
Any insight and/or fixes would be appreciated.
Thanks!