0

I'm trying to install Rails with the package available at installrails.com. When I type "rails --version" into the terminal, I get this:

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

I type in sudo gem install rails, and the terminal says:

Successfully installed rails-4.0.2

But then shows several lines that look like this:

unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/belongs_to.png, skipping

When the command prompt reappears, I re-try "rails --version" and get the same "Rails is not currently installed..." error message.

I've tried several times, restarted by system, etc., and nothing works. I'm on Mac OSX 10.8 (Mountain Lion).

Any ideas? Thanks in advance.

Brian O'Neill
  • 4,705
  • 5
  • 22
  • 26
  • Which Ruby version is installed? The installrails.com site tells OSX 10.8 users to use the package from railsinstaller.com. Have you tried that package? BTW, that error message is irrelevant. See [here](http://stackoverflow.com/questions/18235293/ruby-on-rails-unable-to-convert-x89-from-ascii-8bit-to-utf-8-for-xxx-xxxx-x) – AWM Dec 27 '13 at 16:10
  • Yes, I used the package from RailsInstaller. I'm running ruby v 2.0.0 – Brian O'Neill Dec 27 '13 at 16:19
  • Ok, do you remember whether it worked right after installing from the railsinstaller-package? It should, and then executing `gem install rails` would update rails. Probably that broke it. What is the output of `which ruby`, `which rails` and `ruby -v`? And to make sure this is not an RVM issue: What is the output of `rvm list` and `rvm info`? – AWM Dec 27 '13 at 16:54
  • which ruby = /usr/local/bin/ruby – Brian O'Neill Dec 27 '13 at 20:20
  • which rails = /usr/bin/rails. ruby -v = 2.0.0p353 rvm list = rvm rubies # No rvm rubies installed yet. Try 'rvm help install'. – Brian O'Neill Dec 27 '13 at 20:23
  • OK, this really doesn't look right. I posted an answer, because this is to long for comments. – AWM Dec 27 '13 at 23:45

2 Answers2

0

Don't use sudo with gem install rails (you bypass RVM that way). Railsinstaller should install RVM with Ruby. Both Rails and Ruby should be in subfolders of /usr/local/rvm/. Cleanest option would be to uninstall Rails, local Ruby and RVM and then run the Railsinstaller again. If you installed Ruby via a package manager, uninstall it with that. In any case run:

sudo gem uninstall -a rails
sudo gem cleanup
rm -rf /usr/local/lib/ruby
rm -f /usr/local/bin/ruby 
rm -f /usr/local/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/local/bin/testrb
rm -f /usr/local/bin/ri
rm -f /usr/local/bin/rake
rm -f /usr/local/bin/rdoc
rm -f /usr/local/bin/erb
rvm implode
rm -rf ~/.rvm

Now relogin or reboot and run the Railsinstaller.

AWM
  • 1,130
  • 11
  • 23
  • Thanks for all your help so far. I did as you suggested, but now I'm getting this error at the end of the installation process: Error running sudo su brianeoneill -c'bash -c "PATH=\"$PATH/opt/sm/pkg/active/bin\"git config --global user.name \"Brian O'Neill\"":/bin/sh: -c: line 0: unexpected EOF while looking for matching '"'/bin/sh: -c: line 1: syntax error: unexpected end of file – Brian O'Neill Dec 28 '13 at 02:20
  • Have you checked if RVM, Ruby or Rails are installed? That error message seems to indicate a bug in Railsinstaller. You should open an issue at https://github.com/railsinstaller/railsinstaller-nix/issues – AWM Dec 28 '13 at 19:43
  • And which version of Railsinstaller are you using? – AWM Dec 28 '13 at 19:49
  • BTW, a quick search revealed that you are not alone: https://groups.google.com/forum/#!searchin/railsinstaller/eof|sort:relevance|spell:true/railsinstaller/d6EgAuZ4KkU/5EbbTAydWWkJ However, no answer there so don't expect much help from that google group. Try the github link instead. – AWM Dec 28 '13 at 20:05
0

Answered your question on Reddit, but heres a more specific answer for this issue.

Your Rails is most likely installed either in the system gems, or inside one of the gemsets for whichever version of Ruby you are running inside the RVM or .rbenv gems. Your GEM_PATH is set incorrectly and looking for gems in the wrong location.

Another issue is that you running Rails from the system. Try bundle exec rails and see what is says.

Similar question here: Gem Path Issue: RubyGems looking in the wrong place

Community
  • 1
  • 1
thoughtpunch
  • 1,907
  • 4
  • 25
  • 41