How to set the output directory for bundler logs? - ruby

When I run bundle install it generates a log file in ./.bundle/install.log, which is alright. As the project is using git, I have to ignore this folder additionally.
I already have a folder ./tmp/log/, where I would like to see this install.log file of the bundler, because there are other log files and they are already ignored by git.
Is it somehow possible to change the output directory for log files of the bundler for this project (not via command line arguments, so that other user of the git repository automatically also have their install.log in the tmp directory)? Maybe it's somehow controllable via the Gemfile?

Set the environment variable BUNDLE_APP_CONFIG to use a directory other than .bundle.

Related

install local package so it can find the location of the other files belonging to the project, without adding project directory to `$PATH`

I have a local Go project which requires another data file to live with it, as in
my_project/
go.mod
my_tool.go
data.txt
go.mod:
module my_project/my_tool
go 1.19
Until today, I had the path to my_project directory inserted in the $PATH environment variable so I could build the executable file with go build and run it from anywhere.
Then I wanted to try and run go install (with no arguments, as shown in this tutorial) from my_project directory. So I did and noticed that the command does two things:
go install builds the executable file just like go build does;
go install moves the executable file —the file itself, not its symlink— to the $GOPATH/bin directory.
But the go install command does not put any other project file to $GOPATH/pkg/mod — which is a no-go for my tool which requires its buddy data.txt file to be located in the same filepath.Dir(os.Executable()) directory as the executable file.
Neither does the go install my_project/my_tool command. Hence the question:
Is it possible to install a local Go package in the $GOPATH directory in such a way that it can find the location of the other files belonging to the project without me having to add the project directory to $PATH?

How to remove gcloud fully?

I'm new on mac. I just remove gcloud folders. And now when I open my command line window I always see next:
-bash: /Users/myuser/gcloud/google-cloud-sdk/completion.bash.inc: No such file or directory
-bash: /Users/myuser/google-cloud-sdk/path.bash.inc: No such file or directory
-bash: /Users/myuser/google-cloud-sdk/completion.bash.inc: No such file or directory
I know that made mistake removing not with gcloud command. But we have whad we have. So the main question is how to not get current logs when opening command line window on mac?
The Cloud SDK makes only the following changes to the filesystem on installation:
Adds and populates the Cloud SDK root directory, where you directed the installer.
Configuration goes in the ~/.config/gcloud directory (by default).
Modifies the RC files that you specified on installation (in response to the questions Modify profile to update your $PATH and enable shell command
completion? (Y/n)? and Enter a path to an rc file to update, or leave blank to use [/Users/$USER/.bash_profile]:.
These paths are slightly different on different platforms, but the three types of files (installation files, per-user config, and .rc files) are the same.

Gemsets file isn't working

I have a folder which contains a file named gemsets.rvmrc. The file contains this:
rvm use #pa
Running this code in the terminal successfully switches over to the correct gemset. I'd heard that putting this file in the folder would do that automatically when I CD to that folder, but this isn't the case. Running a ruby file in the same folder, test.rb, gives errors until I run that code in the terminal to switch to the correct gemset.
gemsets.rvmrc is not a supported file, it should be just .rvmrc, but using just gemset not always works - check this bug: https://github.com/wayneeseguin/rvm/issues/2078

How can I install custom git commands (like git hooks) on Windows?

I am trying to use the git-hooks tool on Windows. But, I cannot figure out how to install the git-hooks.sh file such that I can type git hooks --install in Git Bash.
I tried putting it in C:\Program Files (x86)\Git\git, where a lot of other git-*.sh files seem to live. But no luck.
What's the secret?
Like the git-hooks installation instructions say, you need to "Add git-hooks to your PATH environment variable so 'git hooks' can be run" (or copy git-hooks to a directory that already is in your PATH). Neither the C:\Program Files (x86)\Git\git (does that directory really exist for you, I do not see it here) nor the C:\Program Files (x86)\Git\libexec\git-core directories are in your PATH by default. Although in fact any directory which is in your PATH would work, I'd recommend to use the directory where git.exe is located, usually C:\Program Files (x86)\Git\bin. Also be sure to keep the original git-hooks file name, do not rename the file to git-hooks.sh although it is a shell script.

How execute a self contained rake build?

We have an application which is compiled using Rake (on windows). We have a new requirement that one of our clients needs to compile the source code in their own environment using a bat file.
So I need to find a way to execute a rake build without installing anything on the host environment (i.e. everything required to do the build needs to be in the source directory, ruby, gems, etc...) from a batch file.
Anyone have any clues how I could get started with this?
Download and install ruby to a folder inside your project (do not add it to your PATH). After go to this folder and delete any "uninstall" file. Go to the folder again with the console (cmd and then use cd path\to\ruby\folder) and run gem install ... to install everything you need. After add a .bat file to run your app. Something like:
#echo off
rubyfolder\bin\ruby.exe myscript.rb
This is a fully portable ruby installation, you can put it in any computer and it will work as well. (I use it as a portable ruby in my pendrive to let me play everywhere with ruby!)
PS.: rake is a script from bin, you can open it with:
rubyfolder\bin\ruby.exe rubyfolder\bin\rake

Resources