Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku toolbelt breaks rails

I'm in the middle of learning rails, and I'm trying to get heroku up and running. When I install the heroku toolbelt, though, produces a number of errors. If i try to run any rails command, I get something like this:

C:\Users\Ezra\Desktop\Sites\demo_app>rails -v 
C:/Program Files (x86)/ruby-1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in `r
eport_activate_error': Could not find RubyGem railties (>= 0) (Gem::LoadError)
    from C:/Program Files (x86)/ruby-1.9.3/lib/ruby/site_ruby/1.9.1/rubygems
.rb:244:in `activate_dep'
    from C:/Program Files (x86)/ruby-1.9.3/lib/ruby/site_ruby/1.9.1/rubygems
.rb:236:in `activate'
    from C:/Program Files (x86)/ruby-1.9.3/lib/ruby/site_ruby/1.9.1/rubygems
.rb:1307:in `gem'
    from C:/RailsInstaller/Ruby1.9.3/bin/rails:18:in `<main>'

Additionally, running ruby -v gives me ruby 1.9.2p290, even though I have ruby 1.9.3 installed. In trying to fix this, I found that uninstalling ruby 1.9.2p290 would cause my ruby version to simply revert to 1.9.3p125, but after doing so heroku no longer works:

C:\Users\Ezra\Desktop\Sites\demo_app>heroku login
'"C:\Program Files (x86)\ruby-1.9.3\bin\ruby.exe"' is not recognized as an inter
nal or external command, operable program or batch file.  

Gem environment after installing heroku toolbelt:

RubyGems Environment:

  • RUBYGEMS VERSION: 1.7.2
    • RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-mingw32]
    • INSTALLATION DIRECTORY: C:/Program Files (x86)/ruby-1.9.3/lib/ruby/gems/1.9.1
    • RUBY EXECUTABLE: "C:/Program Files (x86)/ruby-1.9.3/bin/ruby.exe"
    • EXECUTABLE DIRECTORY: C:/Program Files (x86)/ruby-1.9.3/bin
    • RUBYGEMS PLATFORMS:
      • ruby
      • x86-mingw32
  • GEM PATHS:
    • C:/Program Files (x86)/ruby-1.9.3/lib/ruby/gems/1.9.1
    • C:/Users/Ezra/.gem/ruby/1.9.1
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
    • http://rubygems.org/

Gem environment after uninstalling ruby1.9.2p290:

RubyGems Environment:

  • RUBYGEMS VERSION: 1.8.16
  • RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [i386-mingw32]
  • INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
  • RUBY EXECUTABLE: C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
  • EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby1.9.3/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-mingw32
  • GEM PATHS:
    • C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
    • C:/Users/Ezra/.gem/ruby/1.9.1
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
    • http://rubygems.org/

I'm running windows 7, and I'm not using rvm because cygwin makes me cry.
Any and all suggestions would be much appreciated.

like image 696
user1452714 Avatar asked Jun 22 '12 18:06

user1452714


1 Answers

Also a newbie here, trying to get rails with heroku running. I ran into exactly the same problem today, first the "Could not find RubyGem railties" issue and then after uninstalling Ruby 1.9.2, the problem with heroku not working anymore. I found 2 ways around it, but not sure if either one is great.

Don't uninstall the ruby version that comes with the toolbelt. Instead either

(1): remove it from the PATH. For me, the toolbelt installation added c:\program files\ruby1.9.3 to my PATH system variable. I already had c:\ruby193 (where I installed ruby myself previously) in my user PATH variable. After removing the one that the toolbelt added from PATH, things started working.
(note: the c:\ruby193 should be placed before c:\program files\heroku\bin int the PATH system variable or else it wont work)

(2): alternatively, I moved c:\ruby193 from my user PATH to my system PATH. Re-installed the toolbelt, and both ruby and heroku work now. But I do have both versions of ruby in my PATH variable.

Not sure if either way is great because I suspect I now have two versions of ruby installed and being used depending on what I'm doing. But at least allowed me to move on to the next problem, now stuck trying to install heroku plugins.

I thought ruby on rails was supposed to make things easy. It's been 4 days of trying to configure 30 different new tools (end rant)

like image 79
Rui Viana Avatar answered Sep 25 '22 04:09

Rui Viana