I'm setting up a rails environment, following instructions from this:
Copy, paste, and run the following, one line at a time:
sudo rvm implode
If it says sudo: rvm: command not found, that's fine.
sudo rm -rf ~/.rvm
brew ls --versions rbenv
If nothing shows up after you run "brew ls --versions rbenv", copy, paste, and run the following:
brew install rbenv
brew install ruby-build
Copy, paste, and run:
open ~/.bash_profile
In the text editor:
Search (command+F) for "rvm", and delete any lines that have it.
Copy and paste the following at the bottom:
export PATH="$HOME/.rbenv/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
Save and quit.
Copy, paste, and run:
rbenv install 2.1.2
rbenv global 2.1.2
and then going through this tutorial
http://tutorials.jumpstartlab.com/projects/blogger.html
Now I'm just trying to run the bin/rails generate model command from my project dir and I'm getting this error
/Users/me/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
from /Users/me/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/me/Desktop/DevProjects/blogger/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
I see other questions with 'generate' causing problems, but none with my specific error. All I could surmise was that it seemd like I was missing a gem called 'bundler/setup' so I did installed that. Now, using the same comamnd bin/rails generate model Article, it told me that I didn't have rake, so I did gem install rake, and then it said I don't have 'i18n' and then I realized its just going through the gems that weer installed with 'bundler' one by one.
I feel like something is going on that is completely beyonod the scope of my understanding of how the PATH works, program environments, etc.
Related
I wrote a script to start my rails application. It includes many services so I want to use that script whenever I restart my computer.
The script is pretty simple, it uses cd <some-folder> and then starts the service defined there. For example, I start druid this way:
cd ~/apache-druid-0.16.0-incubating
./bin/start-micro-quickstart 1>~/log/druid.log 2>&1 &
sleep 10
The sleep is somewhat arbitrary but I know it's sufficient.
When I want to start my rails service, though, it fails.
cd ~/my-app
rails s &
The logs show this error:
/home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.6.3, but your Gemfile specified 2.5.3 (Bundler::RubyVersionMismatch)
from /home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/definition.rb:470:in `validate_runtime!'
from /home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler.rb:101:in `setup'
from /home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
from /home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/alexis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
This clearly tells me that the cd ~/my-app did not work as expected. That is, when I do it in my bash shell, I get a message like so:
alexis#my-vps:~ $ cd my-app/
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/alexis/my-app/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
alexis#my-vps:~/my-app $ _
and I know that it tweaks the environment so my rails application starts as expected (with the correct version of Ruby and other tools).
How do I replicate the behavior of the cd command in my shell script?
When I tried #jvillian's solution (see comment):
# force specific version of rvm
rvm use ruby-2.5.3#my-app
I got the following error:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.
Looking at the info at the specified link, I could see that the idea was to have a login shell so the cd would work. So I changed my script first line from:
#/bin/sh -e
To using:
#/bin/bash -el
and now I can see that the cd works as expected.
This is most certainly because now the script loads the .bashrc and other such files which add the proper cd support, as you get by default in your console.
Now all my services start as expected.
My Rails app was working fine and then I decided to try to update it from 4.0 to 4.2 so I could put it on Heroku. The guide I was following said to update RubyGems so I ran this command:
$ gem update --system
Got this warning:
Warning! `PATH` is not properly set up, '/Users/devon/.rvm/gems/ruby-2.0.0-p353/bin'
is not at first place, usually this is caused by shell initialization
files - check them for 'PATH=...' entries, it might also help to re-add
RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily
in this shell session run: 'rvm use ruby-2.0.0-p353'
I ignored the warning and went to the next step in the guide.
I tried to create a gemset:
$ rvm use 2.0.0p353#rails4.0.2_myapp --create
Then I decided to not update because I was scared of breaking my app. So I just tried to push the app to Heroku without updating.
I ran
$ heroku login
$ heroku create
$ git push heroku master
It failed to push to Heroku because the slug size was too big. I went to fix it and then I started getting this error:
/Users/devon/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:16:in `require': cannot load such file -- stringio (LoadError)
from /Users/devon/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:16:in `<top (required)>'
from /Users/devon/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:1228:in `require'
from /Users/devon/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:1228:in `<module:Gem>'
from /Users/devon/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:115:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
TLDR: App was working. Then I ran these commands:
$ gem update --system
$ rvm use 2.0.0p353#rails4.0.2_myapp --create
$ heroku login
$ heroku create
$ git push heroku master
Now I receive that LoadError error and can't run my app. How can I fix this? I'm assuming something broke when I ran
$ gem update --system
I read this question: no such file to load -- rubygems (LoadError), and someone says to check if you have two ruby versions installed so I ran:
$ which -a ruby
/Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
/usr/bin/ruby
but I don't know what to do after or if it even matters since I only ran those above commands after my app was working fine.
Here are my versions if it matters:
$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12.5.0]
I can't run rails -v because I get the LoadError. But before the error I got this:
$ rails -v
Rails 4.0.2
Before error (I think this updated to a newer version after I ran the update command):
$ gem -v
2.4.8
EDIT
After trying to switch to old version of rubygems:
$ rvm rubygems 2.4.8
I got:
Warning! PATH is not properly set up, '/Users/devon/.rvm/gems/ruby-2.0.0-p353/bin'
is not at first place, usually this is caused by shell initialization
files - check them for 'PATH=...' entries, it might also help to
re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix
temporarily in this shell session run: 'rvm use ruby-2.0.0-p353'.
ruby-2.0.0-p353 - #downloading rubygems-2.4.8
ruby-2.0.0-p353 - #extracting rubygems-2.4.8.....
ruby-2.0.0-p353 - #removing old rubygems..........
ruby-2.0.0-p353 - #installing rubygems-2.4.8.
Error running 'env GEM_HOME=/Users/devon/.rvm/gems/ruby-2.0.0-p353#global GEM_PATH= /Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -d /Users/devon/.rvm/src/rubygems-2.4.8/setup.rb --no-document',
showing last 15 lines of /Users/devon/.rvm/log/1452506634_ruby-2.0.0-p353/rubygems.install.log
[2016-01-11 05:03:54] /Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
current path: /Users/devon/.rvm/src/rubygems-2.4.8
GEM_HOME=/Users/devon/.rvm/gems/ruby-2.0.0-p353
PATH=/Users/devon/.rvm/gems/ruby-2.0.0-p353/bin:/Users/devon/.rvm/gems/ruby-2.0.0-p353#global/bin:/Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin:/Users/devon/.rvm/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/devon/my_stuff/android/adt-bundle-mac-x86_64-20130729/sdk/platform-tools:/Users/devon/my_stuff/android/adt-bundle-mac-x86_64-20130729/sdk/tools
GEM_PATH=/Users/devon/.rvm/gems/ruby-2.0.0-p353:/Users/devon/.rvm/gems/ruby-2.0.0-p353#global
command(7): env GEM_HOME=/Users/devon/.rvm/gems/ruby-2.0.0-p353#global GEM_PATH= /Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -d /Users/devon/.rvm/src/rubygems-2.4.8/setup.rb --no-document
And then the stringio error occurs at the end here
EDIT 2:
$ echo $PATH
/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/devon/.rvm/gems/ruby-2.0.0-p353/bin:/Users/devon/.rvm/gems/ruby-2.0.0-p353#global/bin:/Users/devon/.rvm/rubies/ruby-2.0.0-p353/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/devon/.rvm/bin:/Users/devon/my_stuff/android/adt-bundle-mac-x86_64-20130729/sdk/platform-tools:/Users/devon/my_stuff/android/adt-bundle-mac-x86_64-20130729/sdk/tools
My best guess of what's happening:
The PATH warning that you received is because you updated the local rvm 'gem' command using the system ruby (in /usr/bin);
When you created the gemset, rvm fixed the path, but after this RubyGems from your system ruby is being run using your rvm ruby, and I guess the two versions do not match.
The easiest solution would be to completely remove and reinstall rvm:
$ rm -rf ~/.rvm
Reinstall rvm
Re-run bundle install
To confirm this is indeed the problem before deleting rvm, you can temporarily switch /usr/bin (put this first) and /Users/devon/.rvm/gems/ruby-2.0.0-p353/bin (and this after) in your PATH. At this point, gem -v should still give you 2.4.8, and /Users/devon/.rvm/gems/ruby-2.0.0-p353/bin/gem -v should work fine and give you the newer version of RubyGems.
Alternative solution
Something else (simpler) you could try is to force rvm to reinstall the older version of RubyGems, and then update it again (if required):
rvm rubygems 2.4.8
Have a look here for more details on managing RubyGems with rvm.
After running any homebrew command I get the same error over and over......
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- extend/module (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/Homebrew/global.rb:1:in <top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/Library/brew.rb:16:in'
The best idea – use rvm.
First of all reinstall homebrew.
Then install rvm:
\curl -sSL https://get.rvm.io | bash -s stable
Then you need to provide ruby version and gemset. Go to app folder and create files .ruby-version and .ruby-gemset (including dot). Then add version and gemset in this files. Simple way to do it via console. In console, go to app directory, then:
echo ruby-2.1.3 >> .ruby-version
echo gemsetname >> .ruby-gemset
Of course, provide ruby version that you need. Gemsetname is often equal to app name. So, if your app is called coolapp, your gemsetname should be coolapp. Smth like this:
echo coolapp >> .ruby-gemset
Now, leave app directory and try to enter it again via console:
cd /path/to/your/app
RVM will generate everything you need automatically and you will see stmth like this:
ruby-2.1.3 - #gemset created /Users/username/.rvm/gems/ruby-2.1.3#coolapp
ruby-2.1.3 - #generating coolapp wrappers..........
Boya! This approach will provide same version and gemset name for every developer because files will be included in git. And that will decrease bug level. Everything you need from this moment, just use:
bundle install
And everything should goes right!
I would recommend using rbenv or rvm to manage your development Ruby version and gems. Editing OS X's system Ruby could cause difficult-to-diagnose problems.
Also, you shouldn't need to sudo to install gems. You need to be very careful when sudoing a command since, again, it could cause difficult-to-diagnose problems with the operating system down the road.
So, I'd recommend you re-install homebrew, then install rbenv from git, then gem install away.
I am coming up against issues running a rails server on a local environment. I am on Mac OS X 10.10. I think they relate to the osx-gcc-installer.
Running in Terminal:
$ rails server
Results in:
Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3
Cool, so then I run:
$ rvm install 1.9.3-p550
Which results in:
-bash: rvm: command not found
This solves that:
$ source ~/.bashrc
So I run this again:
$ rvm install 1.9.3-p550
Which produces this:
Warning, new version of rvm available '1.26.1', you are using older version '1.26.0'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p550.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
password required for 'softwareupdate -l':
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: gcc48, libyaml, libksba......
Error running 'requirements_osx_brew_libs_install gcc48 libyaml libksba',
showing last 15 lines of /Users/<user>/.rvm/log/1415842393_ruby-1.9.3-p550/package_install_gcc48_libyaml_libksba.log
++ case "$1" in
++ [[ -t 1 ]]
++ return 1
++ printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ case "$_system_version" in
++ return 1
Requirements installation failed with status: 1.
So, as it suggests, I try:
brew tap --repair
Which says:
Pruned 0 dead formulae
Tapped 161 formulae
And run:
brew doctor
Which gives two warnings both mentioning osx-gcc-installer (which I stupidly installed as part of the Team Treehouse instructions for setting up a dev environment):
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.
I run:
xcode-select --install
And get this:
Usage: xcode-select -print-path
or: xcode-select -switch <xcode_folder_path>
or: xcode-select -version
Arguments:
-print-path Prints the path of the current Xcode folder
-switch <xcode_folder_path> Sets the path for the current Xcode folder
-version Prints xcode-select version information
Which doesn't seem to have done anything so I fetch the CLT from https://developer.apple.com/downloads/index.action# (which I'm pretty sure I had beforehand), install, and reboot.
Do I really need to reinstall my OS to solve this problem? That seems like overkill and I'm hoping somebody has another solution.
Update
On the suggestion of a commenter, I tried this:
$ rvm use 1.9.3 --default
Which returned:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.
So I tried the steps here and
$ source ~/.rvm/scripts/rvm
And re-ran:
$ rvm use 1.9.3
Which resulted in
ruby-1.9.3-p550 is not installed.
To install do: 'rvm install ruby-1.9.3-p550'
So I checked which versions I had using
$ rvm list
And got
rvm rubies
ruby-1.9.3-p0-falcon [ x86_64 ]
ruby-1.9.3-p545 [ x86_64 ]
Then ran:
$ rvm use 1.9.3-p0-falcon --default
And tried:
$ rails server
Which resulted in:
Could not find bcrypt-ruby-3.0.1 in any of the sources
Run `bundle install` to install missing gems.
But bundle install outputs:
/Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/x86_64-darwin13.1.0/openssl.bundle, 9): Library not loaded: ##HOMEBREW_CELLAR##/openssl/1.0.1j/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Reason: image not found - /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/x86_64-darwin13.1.0/openssl.bundle
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/openssl.rb:17:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/net/http/persistent.rb:201:in `<class:Persistent>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/net/http/persistent.rb:191:in `<top (required)>'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendored_persistent.rb:3:in `<top (required)>'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/fetcher.rb:1:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/cli.rb:247:in `install'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/bin/bundle:20:in `block in <top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/bin/bundle:20:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/bin/bundle:23:in `load'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/bin/bundle:23:in `<main>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon/bin/ruby_executable_hooks:15:in `eval'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon/bin/ruby_executable_hooks:15:in `<main>'
Which looks a bit more serious, but at least it isn't telling me to reinstall my OS.
I am getting the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- psych (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/bin/hub:190:in `<main>'
I've tried the suggestions on Stack Overflow which are related libyaml and psych. However, many of those require rvm commands which return the following error:
rvm reinstall 2.0
/Users/richardburton/.rvm/src/ruby-2.0.0-p247 has already been removed.
Removing /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247 - please wait
Error running '__rvm_rm_rf /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247',
please read /Users/richardburton/.rvm/log/1401921952_ruby-2.0.0-p247/remove.rubies.log
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.0.0-p247.
Obviously there are a rvm binaries available at this stage. Any tips or suggestions on how I can get Ruby 2.0 up and running would be much appreciated.
Thanks!
The first error you are receiving is referencing your system ruby, and you're reinstalling with rvm. Try running which ruby. Most likely this can be fixed by updating your path. I wouldn't recommend reinstalling the system ruby, so I'd definitely recommend getting whatever was causing the first error to work with rvm.
If that still isn't working, I'd next try using rbenv instead of rvm. I'm personally a fan of rbenv and have had no issues with my Ruby using it. It's super easy to get up and running, and could be a good temp fix.
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # or whichever profile you are using
$ source ~/.bash_profile # or whichever profile you are using
$ rbenv install <version number>
$ rbenv global <version number>
Links to rbenv info:
rbenv: https://github.com/sstephenson/rbenv
ruby-build: https://github.com/sstephenson/ruby-build#readme
rvm package install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/home/rails/.rvm/usr
I had the same error and this worked for me
Source: https://serverfault.com/questions/442150/how-to-fix-ruby-installation-is-missing-psych-for-yaml-output-on-centos
I've bumped into the same issue and I have tried two solutions:
1) Using ruby-build to build ruby-2.0-p451 with prefix /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr --> DOES NOT WORK (GOT SEGMENTATION FAULT)
2) Replace with the stock version shipped with OSX 10.9 ---> WORKS!!
Please see my snippet on how to do it here: https://gist.github.com/joneslee85/73ece54ba5b3a17e8bb2
Now I can go to sleep. Good luck!