0

After upgrading MacBookPro Retina (2012 model) from Mountain Lion to Maverick I decided to install the latest RoR for dev. I follow the post on 55minutes here, except cannot installed the xcode command-line as it described, which I manually downloaded and installed from Apple Developer site, I can successfully followed other steps to install and setup homebrew, apple-gcc42, autoconf, pkg-config, git, postgresql, qt, rbenv, ruby-build, rbenv-default-gems, rbenv-update, then I can also install the Ruby 2.0.0-p247.

The problem start on 'gem regenerate_binstubs, where terminal returns:

> ERROR:  While executing gem ... (Gem::CommandLineError)
> Unknown command regenerate_binstubs

I then init the postgresSQL but did not configure it as I had second thought to use stock Sqllite.

Then I update the rbenv, brew and try to new a rails project, and terminal returns the following error:

> run  bundle install Fetching gem metadata from
> https://rubygems.org/.......... Fetching gem metadata from
> https://rubygems.org/.. Resolving dependencies...
> 
> ArgumentError: invalid byte sequence in UTF-8 An error occurred while
> installing rake (10.1.0), and Bundler cannot continue. Make sure that
> `gem install rake -v '10.1.0'` succeeds before bundling.

I checked other posts and see similar error msg, try to solve by including the LANG in .bash_profile as follow but no use:

> export LANG="en_US.UTF-8" 
> export LC_ALL="en_US.UTF-8"

Below is the content of my bash_profile:

export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH↲
export EDITOR='subl -w'

export PATH=/usr/local/bin:$PATH

export RBENV_ROOT="$HOME/.rbenv"

if [ -d $RBENV_ROOT ]; then
  export PATH="$RBENV_ROOT/bin:$PATH"
  eval "$(rbenv init -)"
fi

I hope someone can share a light on where I might do wrong. Otherwise I plan to uninstall rbenv and change to rvm to continue the installation of RoR. Thanks in advanced.

Ben K.
  • 23
  • 1
  • 7
  • It seems the UTF-8 problem is caused by this line in my .bash_profile: export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH↲ After deleting it the problem is gone and the new application could move on, however it stops again saying I don't have permission on accessing /Library/Ruby/Gems/2.0.0/build_info/mime-types-1.25.1.info – Ben K. Dec 03 '13 at 12:47
  • After struggling on this question for a week, I finally decide to drop rbenv and turn to rvm. Following this post (http://railsapps.github.io/installrubyonrails-mac.html) on RailsApp, I am now able to use RoR and new applicaton without any problem. Just remember to uninstall rbenv, clean everything related to rbenv in .bash_profile and also rm -rf ~/.rbenv before you get started. – Ben K. Dec 04 '13 at 05:49
  • FYI, exporting ```LANG``` and ```LC_ALL``` as suggested by the OP did the trick for me – opsidao Jan 21 '14 at 10:34

2 Answers2

0

After struggling on this question for a week, I finally decide to drop rbenv and turn to rvm. Following this post on RailsApp, I installed RoR and new application successfully without any problem. Just remember to uninstall rbenv, clean everything related to rbenv in .bash_profile and also rm -rf ~/.rbenv before you get started.

For the answer of the question, which is about the UTF-8 error, turns out it's caused by the $PATH setting I put on the first line in .bash_profile. Deleting it then the new application could move on (though it hits another wall about write permission to '/Library/Ruby/Gems' folder). It's a lesson learnt that you never follow multiple posts to install a Rails' dev environment unless you know what you're doing.

However, I have to say that rbenv seems still not friendly to user, a newbie like me to install on MAC, but it's better to install on ubuntu which I got success in the first time.

Ben K.
  • 23
  • 1
  • 7
-1

In my case it was an issue with Ruby not linking properly to openssl, and reinstalling Ruby per this answer (https://stackoverflow.com/a/25493698) solved it.

Community
  • 1
  • 1
campfire
  • 11
  • 3