Why does second terminal tab prompt bundle install - ruby-on-rails

If I run rails s in the terminal, it works. If I open a new terminal window or tab and run rails c, I get the following error: Run bundle install to install missing gems. If I type cd .. and then cd back into the directory and run rails c again, it works. My question is what would be causing this to occur?

I was facing some problems but didn't find the perfect solution.
An alternate working solution for the same is below which worked for me well as expected.
Steps are as below:
nano ~/.bash_profile
Then add the following code at the end of your bash_profile file
current_dir=$(pwd)
cd $current_dir
Let me know if this worked for you.

Related

How to install Gridsome: zsh: command not found: gridsome

I'm attempting to create a new Gridsome project and continually receive the following message in the terminal:
zsh: command not found: gridsome
Steps I've taken
(https://gridsome.org/docs/)
npm install --global #gridsome/cli
cd testProjects
gridsome create my-gridsome-site
At this point i receive the error and cannot seem to find a way to resolve it.
I solved this by using yarn for installation. So simply run the following commands :
Install yarn. On Mac OS do it using homebrew. brew install yarn.
cd to place where you would like your project to be, and then run gridsome create my-gridsome-site.
However, not sure why installing with npm, doesn't work.
if you install globally like this yarn global add #gridsome/cli
you need to add this on your path in .zshrc if you use zsh
~/.yarn/bin
here's my .zshrc config in the last line, focus on the GLOBAL one
export TWEEGO=$HOME/DEV/TWINE/tweego
export ANDROID_SDK=$HOME/Library/Android/sdk
export GLOBAL=$HOME/.yarn/bin
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$TWEEGO:$GLOBAL:$PATH

Brew install nvm. nvm: command not found

After installing nvm with brew, and running nvm, it says nvm: command not found
How can I get the command to execute?
There are two steps to installing nvm with brew.
First use brew to install the application:
brew install nvm
Then take a look at the brew info "caveats" section, to see what else you have to do:
brew info nvm
You might see something like (this can change!):
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
Add the following to ~/.bash_profile or your desired shell
configuration file:
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
If you do not have a ~/.bash_profile file, then you can simply create one.
Make sure to restart your terminal before trying to run the nvm command again.
I followed #user3207874's answer, but it still wasn't working for me. I had to run this command after those steps:
source $(brew --prefix nvm)/nvm.sh
From the docs:
Your system may not have a [.bash_profile file] where the command is
set up. Simply create one with touch ~/.bash_profile and run the
install script again
you might need to restart your terminal instance. Try opening a new
tab/window in your terminal and retry.
Restarting worked for me...Why can't all bugs be so easy?!!
Just adding some explanation for Aaditya's answer to explain why it works. I can't replay because I don't have enough reputation.
Basically there are 2 important steps to follow
Export NVM_DIR location. You need to create this folder if it doesn't exist first.
export NVM_DIR="$HOME/.nvm"
Second you need to source nvm's script. It is usually like this
. "/usr/local/opt/nvm/nvm.sh"
If the path on the second step does work it may be because the path is different in your device. One easy way to find its path is with the command
brew --prefix nvm
The output will be the path for the nvm installation directory in which the nvm.sh file resides. Setting the command inside $() will create a subshell to get that path. We can use it to source the nvm.sh script wherever it is located like this:
. $(brew --prefix nvm)/nvm.sh
Using that command is a replacement for . "/usr/local/opt/nvm/nvm.sh" in your .bash_profile.
please run this command
source ~/.nvm/nvm.sh
I had the same problem after running npm install
The following solution worked for me:
Run brew doctor to find broken symlinks for NPM
Run brew cleanup to clean them up
Just adding some new info.
The docs for nvm have this note:
Homebrew installation is not supported. If you have issues with homebrew-installed nvm, please brew uninstall it, and install it using the instructions below, before filing an issue.
So for anyone coming here, potentially uninstall via brew and install as per recommendation : https://github.com/nvm-sh/nvm

Flutter run command error : FlutterView.send called on a detached view

Can anyone tell me why my app is not installing at all and ending with the error message
Observatory connection never became ready.
the app was working perfectly fine until yesterday .
I have changed the channel to master yesterday in the command prompt and from then on the app never runs.
I even switched back to channel alpha but still no use.
I have attached a screenshot of the command prompt where the installation was stuck forever.
I am not so sure if I need to reinstall the flutter. I am worried if I uninstall the flutter now it may not configure properly and I might break it forever.
Please can someone tell me what exactly might have gone wrong.
Many Thanks,
Mahi
Instead of reinstall try with following: (Mac)
Set Path Variable: via following terminal command
export PATH=~/flutter/bin:$PATH;
that is bin folder path of flutter.
export PATH=[PATH_TO_FLUTTER_GIT_FOLDER]/bin:$PATH
https://flutter.io/setup-macos/#update-your-path
If above not worked. Check with the Dart version
dart --version
Install the latest dart version:
brew install dart --devel
Hope this helps others.
For Mac
open terminal
$ echo $PATH
it will show like this
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
it means you need to add flutter in to path
Open Finder presss command + shift + G
Put /etc/paths in dialog and press GO
Copy the file "paths" and paste it on desktop
Then open the pasted "paths" file from desktop
and add following line into end of the file "/flutter/bin"
Then copy that file and again paste it on /etc/paths
same like step no 2
it will ask you to replace or not
press replace
Now if you hit $ echo $PATH on terminal it will show
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/swagat/development/flutter/bin
Now your $flutter doctor will work perfectly
The solution is from Google Groups #Flutter-Dev
Thank you very much for your reply #Michael Thomsen.
I've tried what you have suggested and the details are as follows:
When I used flutter run -v command the command prompt output is as follows:
It was stuck for a while at waiting for port connection if I am not wrong.
So I've used AndroidStudio, File>Open and selected android/ folder to run the app then the gradle was showing an error:
Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.2.0) and test app (25.4.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
I modified the build.gradle(Module:app) to show the correct version of 25.2.0 which was previously showing 25.4.0.
dependencies {
androidTestCompile 'com.android.support:support-annotations:25.2.0'
}
I just saved the changes inside android studio and the gradle sync completed without any errors.
Now I can run the app from inside Android Studio and also from IntelliJ IDE.
Thanks very much Michael this solved my problem.
Reinstalling flutter would be my starting point. If this problem persists, please post the output of $>flutter doctor and a description of what exactly leads to this error.

Installing Chisel

I'm trying to install Chisel.
I ran the following commands in command line.
brew update
brew install chisel
the final step is to follow the instructions that Homebrew displays to add chisel to your ~/.lldbinit.
I cannot find .lldbinit file. Any ideas?
I figured it out. Simply create .lldbinit in your home directory. I used sublime and added the following text to the file.
# ~/.lldbinit
...
command script import /path/to/fblldb.py
make sure you update the 'path' portion with your actual path. This can be obtained from command line when you do 'brew install chisel'
Save, restart Xcode. Done!
.lldbinit file is not required for lldb to work so it is not created by default. If you don't have it already just create new empty file and add all necessary lines to it.

reset $PATH homebrew

I'm very new to coding and I was beginning to set up my development environment according to a Mackenzie Child youtube video. After downloading iTerm and installing homebrew, I was having trouble with updating the Ruby 2.0.0 version to 2.2.2. In the video Mackenzie changes his ~/.bash_profile and restarts iTerm to resolve the problem. I did the same thing except now iTerm doesn't recognize any commands. I can't access bash_profile or run any commands.
I believe the problem occurred when I changed my bash_profile except I can't access/find it anywhere. The command line doesn't let me access it either.I can't find any solutions to my specific problem online so I'm grateful if anyone can help.
Screenshot of iTerm
Thanks!
If restarting iTerm didn't fix your problem, then:
Open iterm.
Run export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin .
Run open -a TextEdit ~/.bash_profile . Paste what's in that file here.

Resources