Very simple script that installs homebrew in mac os 10.10.5:
iMac-phuocho:~ phuocho$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to phuocho:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
Press RETURN to continue or any other key to abort
it appears like this 4 hours .please help me.
The script is waiting for you to confirm that you are happy for it to perform the listed tasks.
Press RETURN to continue or any other key to abort
means that it is waiting for you to press enter before it continues
Related
This is my first time using AWS's Code Deploy, so I'm probably/hopefully missing something obvious.
I'm trying to deploy a Ruby On Rails application to EC2 via Code Deploy.
Originally I wanted two AfterInstall stages, one to install things the system needs (RVM, Ruby, Postgres) and one to install gems. However, the second AfterInstall wouldn't see rvm or bundle. To save time I figured I would worry about splitting this out later and bundle install in the same hook, which works.
My issue is then with ApplicationStart, which can't see bundle - making bundle exec puma... impossible. I thought it was maybe because rvm wasn't kicking in to see which version of Ruby to use, so I added a rvm use ruby-3.1.0 but it fails to see rvm.
Can someone explain what I'm missing that would allow individual hooks to build off of what has come before?
My appspec.yml looks like this;
version: 0.0
os: linux
files: #copy files
- source: /
destination: /var/www/timesheets/deployment
permissions: # def need deployment dir set to ec2-user, maybe not rvm?
- object: /var/www/timesheets/deployment
owner: ec2-user
group: ec2-user
- object: /usr/local/rvm
owner: ec2-user
hooks:
BeforeInstall:
- location: deploy/arrange_folders
runas: root
AfterInstall:
- location: deploy/install
timeout: 900
ApplicationStart:
- location: deploy/start
The BeforeInstall hook moves some folders about to back-up the previous deployment.
My install script;
#!/bin/bash
set -e #exit on error
sudo yum install postgresql-devel
sudo amazon-linux-extras install postgresql13
mkdir -p /var/www/timesheets
cd /var/www/timesheets
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install ruby-3.1.0
gem install bundler
cd /var/www/timesheets/deployment
bundle install
My start script;
#!/bin/bash
set -e #exit on error
cd /var/www/timesheets/deployment
source /home/ec2-user/.env # tmp way to grab some ENVs
# rvm use ruby-3.1.0 # commented out because it also breaks
bundle exec puma -C config/puma.rb
Error message
[stderr]/opt/codedeploy-agent/deployment-root/515737d9-378b-4ecc-b2a9-080af25cb74a/d-XKE49L7SL/deployment-archive/deploy/start: line 6: bundle: command not found
Notes
This is very much a spike, I'm aware that e.g. there is a better way to grab the gpg2 keys for rvm, I need a open another port which I will get around to! Having said that, all comments welcome!
State is likely not the problem here as even within the same script (install), the command (bundle) that you've installed immediately before (gem install) cannot be found.
A few things to check/consider here:
Consider moving the install script. Dependencies such as package managers, frameworks, etc. are typically placed into the BeforeInstall hook. See here for more information.
Check the full CodeDeploy log on the EC2 instance to see if there any other issues mentioned. See here for more information.
Run the same script on a fresh EC2 instance using the same image as your target instance to verify if it is executed successfully.
If the script runs through successfully, validate the deployment package on the target instance. See here for more information.
Hope that helps to identify the root cause!
When I try to install a new cask a message appears:
"The default Caskroom location has moved to /usr/local/Caskroom"
How to move the old directory without breaking the links to the new location?
Recipe
# FIRST SOLUTION
# reinstall all casks (can be slow)
brew cask install --force $(brew cask list)
# --------------------------------------
# SECOND SOLUTION
# move cask directory to its new location
mv /opt/homebrew-cask/Caskroom /usr/local
# relink existing casks to the new location
for f in ~/Applications/*.app; do oldloc="$(readlink "$f")"; [[ -e $oldloc ]] || ln -sf "/usr/local${oldloc#/opt/homebrew-cask}" "$f"; done
See here for more information: https://github.com/caskroom/homebrew-cask/issues/21913
I had same issue and i did following which fixed it.
1.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
2.
MBP:~$ brew install terraform
==> Downloading https://homebrew.bintray.com/bottles/terraform-0.7.5.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring terraform-0.7.5.el_capitan.bottle.tar.gz
==> Caveats
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/terraform/0.7.5: 4 files, 123.3M
Hello I downloaded Python from Homebrew but my computer seems to be using the pre installed Apple version.
Is there a way to change this so that my computer can use the Homebrew Python instead?
I read something about bash files on here but I can only see the apple stuff in there. There is nothing in there from usr/local/Cellar.
Because i do not know what you already did and if you installed Homebrew correctly or not i would write out the steps of how you should have done it. I will tell you how to install Homebrew and how to point your package to your path so it locates your python before the Apple python. Also i am assuming you have El Capitan.
1) Download Xcode form App Store if you don't have it.
Steps 2-9 are using Terminal (Applications -> Utilities -> Terminal)
2) Install the command line tools
xcode-select --install
3) Install Homebrew (This will install Homebrew to the root):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
4) Update brew and check with the doctor to fix any issues:
brew update
brew doctor
5) Check if you already have a .bash_profile and if not create it.
a) Check for the .bash_profile
cd $HOME
ls -al
If you see .bash_profile on the list skip (b)
b) Create the bash profile
cd $HOME
touch .bash_profile
7) Export the Path to the bash file:
cd $HOME
echo export PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile
source ~/.bash_profile
8) Install your package, for example:
brew install python
9) Run the doctor and fix any issues:
brew doctor
10) Check the Path and make sure that the /usr/local/bin: is before /usr/local/
$PATH
If during the process you get an error saying that you do not have permission add sudo in front of the command and try again.
Hope it helps!
I am using Windows 10 Insider built with Bash enabled. lsb_release shows its Ubuntu 14.04 LTS. So, I was wondering finally I can install RoR on Windows 10 and not use other installers. Because they say its Ubuntu on Windows.
I am following GoRails Guide by Chris Oliver to set RoR on Ubuntu 14.04 Win10. I tried both method using RVM & Rbenv but I ended up with errors
I also asked Chris to write a guide for this on his website and he thought it would be a great idea and but his only concern was opening up ports with Linux Software on Windows and connect to it
I am sure someone will soon find a way to install rails on Windows 10 but meanwhile I want to know if its possible or not? If yes what is it that I am doing wrong. Help me to fix it. Also what should I use for this RVM or RBENV. Which would be better in this case?
(Note: Please let me know if this looks like two different questions. I will edit it. I don't even know if its possible or not. Fixing errors is the later part.)
Here is rbenv error messages:
$ rbenv install 2.3.0
Downloading ruby-2.3.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...
BUILD FAILED (Ubuntu 14.04 using ruby-build 20160426-12-gf03f7f8)
Inspect or clean up the working tree at /tmp/ruby-build.20160513120821.313
Results logged to /tmp/ruby-build.20160513120821.313.log
Last 10 log lines:
rm -f ../../../.ext/x86_64-linux/io/wait.so *.o *.bak mkmf.log .*.time
rm -f Makefile extconf.h conftest.* mkmf.log
rm -f core ruby *~
rmdir --ignore-fail-on-non-empty -p 2> /dev/null || true
make[2]: Leaving directory `/tmp/ruby-build.20160513120821.313/ruby-2.3.0/ext/io/wait'
make[1]: Leaving directory `/tmp/ruby-build.20160513120821.313/ruby-2.3.0'
Generating RDoc documentation
./ruby is not found.
Try `make' first, then `make test', please.
make: *** [rdoc] Error 1
RVM error messages:
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...
BUILD FAILED (Ubuntu 14.04 using ruby-build 20160426-12-gf03f7f8)
Inspect or clean up the working tree at /tmp/ruby-build.20160513120821.313
Results logged to /tmp/ruby-build.20160513120821.313.log
Last 10 log lines:
rm -f ../../../.ext/x86_64-linux/io/wait.so *.o *.bak mkmf.log .*.time
rm -f Makefile extconf.h conftest.* mkmf.log
rm -f core ruby *~
rmdir --ignore-fail-on-non-empty -p 2> /dev/null || true
cooldudeabhi#ACERASPIRE:~$ rvm install 2.3.0
ruby-2.3.0 - #removing src/ruby-2.3.0..
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby-2.3.0.ta r.bz2
Checking requirements for ubuntu.
Requirements installation successful.
df: Warning: cannot read table of mounted file systems: No such file or director y
ruby-2.3.0 - #configure
ruby-2.3.0 - #download
ruby-2.3.0 - #validate archive
cat: /dev/fd/63: No such file or directory
cat: /dev/fd/63: No such file or directory
The downloaded package for https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby -2.3.0.tar.bz2,
Does not contains single 'bin/ruby' or 'ruby-2.3.0',
Only '' were found instead.
Mounting remote ruby failed with status 4, trying to compile.
df: Warning: cannot read table of mounted file systems: No such file or director y
Checking requirements for ubuntu.
Requirements installation successful.
grep: write error: Broken pipe
sort: fflush failed: standard output: Broken pipe
sort: write error
Installing Ruby from source to: /home/cooldudeabhi/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your co nnection...
ruby-2.3.0 - #extracting ruby-2.3.0 to /home/cooldudeabhi/.rvm/src/ruby-2.3.0..rvm install 2.3.0
It appears it isn't possible as of build 14342, as this is an issue with Bash on Windows itself [1].
Some internal testing builds are reported to be able to install ruby via RVM, but it does not appear any of these builds are currently available to the 'fast' ring of Windows Insiders at this time [2].
Update: 2016-05-27
One step closer: Build 14352 was released on 2016-05-26 [3]. After running apt-get update && apt-get upgrade I was able to successfully install ruby-2.3.1 using both rvm and rbenv.
As noted in source #1 below, in order to fully utilize rvm I needed to run bash with /bin/bash --login. To achieve this I appended it to the Bash on Ubuntu on Windows shortcut's target field like this:
C:\Windows\System32\bash.exe -c "cd ~ && /bin/bash --login"
Now I can rvm use ruby-2.3.1 --default, gem install rails and rails new banana, however when bundler tries to run, there is an error:
dozers#DRAGONSTONE:~/banana$ bundle
--- ERROR REPORT TEMPLATE -------------------------------------------------------
...
Error details
ArgumentError: parent directory is world writable but not sticky
/home/dozers/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tmpdir.rb:93:in `ensure in mktmpdir'
/home/dozers/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tmpdir.rb:95:in `mktmpdir'
/home/dozers/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:29:in `update'
...
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=parent+directory+is+world+writable+but+not+sticky&type=Issues
Update: 2016-06-03
The cat: /dev/fd/63: No such file or directory error is reported to be fixed in an upcoming Windows Insider release [4], but this doesn't seem to be fatal.
As a temporary workaround for the bundler error, issuing chmod -R +t ~/.bundle/cache appears to do the trick and now you have a working rails installation [5].
Sources:
https://github.com/Microsoft/BashOnWindows/issues/9#issuecomment-207978726
https://github.com/Microsoft/BashOnWindows/issues/222#issuecomment-214561156
https://blogs.windows.com/windowsexperience/2016/05/26/announcing-windows-10-insider-preview-build-14352/
https://github.com/Microsoft/BashOnWindows/issues/266#issuecomment-219576351
https://github.com/bundler/bundler/issues/4630#issuecomment-223576426
OSX - 10.8.5
Running Homebrew
rvm
Whenever I open a new shell I get the following and I think, "ugh", thats not good.
Last login: Thu Nov 7 07:12:43 on ttys000
-bash: /etc/profile.d/rvm.sh: No such file or directory
I then run echo $PATH and get
Matthews-MacBook-Pro-2:~ Matthew$ echo $PATH
/Users/Matthew/.rvm/gems/ruby-1.9.3-p448/bin:/Users/Matthew/.rvm/gems/ruby-1.9.3-p448#global/bin:/Users/Matthew/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/Matthew/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/ImageMagick/bin:/usr/local/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/rvm/gems/ruby-1.9.3-p448/bin:/usr/local/rvm/gems/ruby-1.9.3-p448#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p448/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Matthews-MacBook-Pro-2:~ Matthew$
I think my .bash_profile is a mess and I really would appreciate some ninja guidance...
Thank you
When you open the Terminal, you begin a bash shell session. You can set some commands to run every time you start a bash session. The place to put these initial bash commands is usually in ~/.bashrc or ~/.bash_profile. See if you have any reference to the file /etc/profile.d/rvm.shthere and check if that file actually exists on your machine.
UPDATE:
I have heard of problems if o installed rvm as sudo. Try removing it and reinstalling again without sudo:
sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh \
/usr/local/rvm /usr/local/bin/rvm
sudo /usr/sbin/groupdel rvm # this might fail, it's not that important
Reopen terminal and make sure rvm ins removed:
env | grep rvm
It should return empty if not try to restart de computer. After it return empty you can install it:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)