Errors while installing Calabash for iOS - ruby

I followed the steps in the following and tried to install calabash.
https://github.com/calabash/calabash-ios
But when I run the command calabash-ios setup got the following errors.
$ calabash-ios setup
~/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in
`to_specs': Could not find 'calabash-cucumber' (>= 0) among 7 total gem(s) (Gem::LoadError).
Tried some more commands which I mentioned below
$ which cucumber
~/.rvm/rubies/ruby-1.9.3-p484/bin/cucumber
$ gem list
bundler (1.5.2)
bundler-unload (1.0.2)
executable-hooks (1.3.1)
gem-wrappers (1.2.4)
rake (10.1.1)
rubygems-bundler (1.4.2)
rvm (1.11.3.8)
$ which -a ruby
~/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
/usr/bin/ruby
$ ruby gem
ruby: No such file or directory -- gem (LoadError)
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.1
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-darwin12.5.0]
- INSTALLATION DIRECTORY:(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484
- RUBY EXECUTABLE:(HomeDirectory)/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
- EXECUTABLE DIRECTORY:(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484/bin
- SPEC CACHE DIRECTORY:(HomeDirectory)/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
-(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484
-(HomeDirectory)/.rvm/gems/ruby-1.9.3-p484#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- ~/.rvm/gems/ruby-1.9.3-p484/bin
- ~/.rvm/gems/ruby-1.9.3-p484#global/bin
- ~/.rvm/rubies/ruby-1.9.3-p484/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
- ~/.rvm/bin
EDIT :
$rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
~/.rvm/gems/ruby-1.9.3-p484#global/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-1.9.3-p484#global/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
$rake --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:632:in `raw_load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
~/.rvm/gems/ruby-1.9.3-p484#global/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
~/.rvm/gems/ruby-1.9.3-p484#global/bin/rake:23:in `load'
~/.rvm/gems/ruby-1.9.3-p484#global/bin/rake:23:in `<main>'
~/.rvm/gems/ruby-1.9.3-p484#global/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-1.9.3-p484#global/bin/ruby_executable_hooks:15:in `<main>'
I prefer Ruby upgrade to deletion.
Could please some one help me in resolving the issue.
Note : Edited terminal output in the question.

my best guess would be gem install calabash-cucumber.which cucumber just references the bin from the cucumber gem not the calabash-cucumber gem

I had this same problem and only resolved it by removing rvm:
rvm implode
And some additional steps: How can I remove RVM (Ruby Version Manager) from my system?
I would recommend restarting Terminal after doing the above.
From there I only had Ruby 1.8 on my machine. So I updated it using Mac Ports:
sudo port install ruby19 +nosuffix
I would recommend restarting Terminal again at this point. Hopefully now if you run ruby -v you should see the new version of Ruby displayed.
Then restart the calabash install with:
sudo gem install calabash-cucumber
And continue on with the setup process after that.

Since it returns the message that calabash could not be found... Add gem 'calabash-cucumber' to your Gemfile and bundle install it and try again

Related

How to install Jekyll on Mac 10.11.6

Hello and thanks for your help in advance.
I'm having trouble installing Jekyll because I receive the following error:
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument
This is slightly different than the question already posted, here I've also followed all of those recommendations but nothing is working.
Current xCode version: 8
Current Ruby version: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
Here is the backtrace of the install:
Lisas-MBP:gems LMS$ gem install jekyll --backtrace
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in `clock_gettime'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:672:in `request'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:531:in `block in fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1103:in `block (3 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1101:in `block (2 levels) in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1100:in `block in resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:1098:in `resolv'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:522:in `fetch_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:512:in `each_resource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/resolv.rb:493:in `getresource'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/remote_fetcher.rb:99:in `api_endpoint'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source.rb:47:in `api_uri'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source.rb:86:in `dependency_resolver_set'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:24:in `block in pick_sets'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source_list.rb:98:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/source_list.rb:98:in `each_source'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:23:in `pick_sets'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/best_set.rb:29:in `find_all'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:152:in `find_all'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:55:in `add_always_install'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/dependency_installer.rb:474:in `resolve_dependencies'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:239:in `install_gem'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:300:in `block in install_gems'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `each'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:296:in `install_gems'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/commands/install_command.rb:203:in `execute'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command.rb:308:in `invoke_with_build_args'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command_manager.rb:169:in `process_args'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/command_manager.rb:139:in `run'
/usr/local/Cellar/ruby/2.3.1_1/lib/ruby/2.3.0/rubygems/gem_runner.rb:55:in `run'
/usr/local/bin/gem:21:in `<main>'
Here is my gem env
Lisas-MBP:Code LMS$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/LMS/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/LMS/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.3.1_1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.3.0
- /Users/LMS/.gem/ruby/2.3.0
- /usr/local/Cellar/ruby/2.3.1_1/lib/ruby/gems/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /opt/local/bin
- /opt/local/sbin
- /usr/local/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /user/local/bin
- /Users/LMS/.rvm/bin
- /Applications/Postgres.app/Contents/Versions/9.4/bin
I'm able to successfully install jekyll on my Mac but I'm not using system Ruby. I'd highly recommend using RBEnv to manage your Ruby installation on OSX. You'll find it much easier to work with than trying to deal with the system version or the Brew version. With it you can swap out Ruby versions easily and gem management is simpler.
Thanks for all the responses.
I ended up uninstalling ruby and re-installing it.
Then I started getting other issues, but new issues are good!
And this finally fixed it.
sudo gem install -n /usr/local/bin/ jekyll
Now I'm running ruby 2.0. Hope this helps, let me know if anyone has any questions!

Cannot run Jekyll on Ubuntu 12.04

I encountered this issue:
gabriele # osiris { ~ } [ ven nov 15 ] [ 12:57 ]
> jekyll
/var/lib/gems/1.8/gems/highline-1.6.19/lib/highline/system_extensions.rb:210: warning: Insecure world writable dir /home/gabriele in PATH, mode 040777
/var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:365:in `require_program': program version required (Commander::Runner::CommandError)
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `each'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `require_program'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:52:in `run!'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/import.rb:10
from /usr/local/bin/jekyll:19
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- json (LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll/filters.rb:2
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll.rb:43
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/jekyll:7
from /usr/local/bin/jekyll:19:in `load'
from /usr/local/bin/jekyll:19
after I've installed jekyll on Ubuntu 12.04 with
sudo apt-get install ruby1.9.1-dev && sudo gem install jekyll
This is my gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/gabriele/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
How can i solve it?
Running gem install json should fix the LoadError.
Commander throws that program version required error whenever there is a problem loading in the executable (in this case, bin/jekyll). As 1.8.7 can't load an internal json library (introduced in 1.9), you'll need to install the gem.

cannot load such file -- mechanize.rb (LoadError) on OSX 10.6

I have a simple script:
require 'rubygems'
require 'mechanize'
p 'Success!'
When I run the script, I get:
/Users/.../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mechanize.rb (LoadError)
from /Users/.../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from test.rb:2:in `<main>'
In desperation I installed RVM and updated ruby from system 1.8.7. Yet I am still getting the same error as before I installed rvm. I am now running:
mute:nfg ..$ ruby -v
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin10.8.0]
irb reports the same:
1.9.3p385 :001 > require 'rubygems'
=> false
1.9.3p385 :002 > require 'mechanize'
LoadError: cannot load such file -- mechanize
from /Users/../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):2
from /Users/../.rvm/rubies/ruby-1.9.3-p385/bin/irb:16:in `<main>'
I have re-installed mechanize, using sudo and without, several times from the project directory.
I have tried manually requiring the gem, along with its full path.
mute:nfg ..$ ruby -l ~/.gems/gems/mechanize-2.5.1/lib/mechanize.rb
/Users/../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mime/types (LoadError)
from /Users/../.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/../.gems/gems/mechanize-2.5.1/lib/mechanize.rb:4:in `<main>'
(I have tried installing mime-types, too.)
RVM lists the gem fine:
mute:nfg ..$ rvm all do gem list
*** LOCAL GEMS ***
...
libxml-ruby (2.3.3, 1.1.2)
mechanize (2.5.1)
mime-types (1.21, 1.19)
...
As does gem:
mute:nfg ..$ gem list
*** LOCAL GEMS ***
...
libxml-ruby (2.3.3, 1.1.2)
mechanize (2.5.1)
mime-types (1.21, 1.19)
...
Curiously, the $GEM_PATHs ~/.rvm/gems/ruby-1.9.3-p385, ~/.rvm/gems/ruby-1.9.3-p385#global and ~/.rvm/gems/ruby-1.9.3-p385#project appear mostly empty (two gems in the first, none in either of the last). However, the GUI JewelleryBox confirms that all three gemsets contain Mechanize.
EDIT: Here is the result of gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.25
- RUBY VERSION: 1.9.3 (2013-02-06 patchlevel 385) [x86_64-darwin10.8.0]
- INSTALLATION DIRECTORY: /Users/../.gems
- RUBY EXECUTABLE: /Users/../.rvm/rubies/ruby-1.9.3-p385/bin/ruby
- EXECUTABLE DIRECTORY: /Users/../.gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/../.gems
- /Users/../.gem
- /usr/lib/ruby/gems/1.8
- /Library/Ruby/Gems/1.8
- /usr/bin
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
- "gemhome" => "/Users/../.gems"
- "gempath" => ["/Users/../.gem", "/usr/lib/ruby/gems/1.8", "/Library/Ruby/Gems/1.8", "/usr/bin"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
Can anyone help?
your environment is set to use custom paths for gems, this confuses rubygems as you install to places which are not available in PATH
run rvm get head and carefully read the outputs, it will warn you about entries in *gemrc that break rubygems / RVM

Updating Heroku gem, on RVM (OSX), has resulted in a LoadError and "broken" heroku gem. What is safest way to fix?

I have been using RVM (v1.14.11 & JewelryBox GUI), with OSX 10.6.8, for over a year now without any problems. I have two rubies installed (1.9.2 & 1.9.3), plus various gemsets for each ruby.
Since I just finished migrating my current databases to their new offerings, I figured I may as well update the heroku gem (was 2.14). So I selected, via rvm, my ruby-1.9.2-p290#rails gemset, opened up Terminal, and ran "heroku udpate".
I did not notice any errors during the update, but I tried running a "heroku version", plus various other "heroku" commands, and now receive the following error:
/Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- netrc (LoadError)
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.heroku/client/lib/heroku/auth.rb:6:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.heroku/client/lib/heroku/client.rb:4:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/gems/ruby-1.9.2-p290#rails/gems/heroku-2.14.0/lib/heroku.rb:6:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/gems/ruby-1.9.2-p290#rails/gems/heroku-2.14.0/bin/heroku:6:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-1.9.2-p290#rails/bin/heroku:19:in `load'
from /Users/me/.rvm/gems/ruby-1.9.2-p290#rails/bin/heroku:19:in `<main>'
I notice that there are some references to "1.9.1" in the above, which was the original gemset I had isntalled with rvm, then updated it to "1.9.2". Perhaps this is the cause?
Running "gem environment" gives:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.10
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin10.8.0]
- INSTALLATION DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290#rails
- RUBY EXECUTABLE: /Users/me/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290#rails/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/me/.rvm/gems/ruby-1.9.2-p290#rails
- /Users/me/.rvm/gems/ruby-1.9.2-p290#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I do have another gemset (ruby-1.9.3-p194#rails32) which also contains the "heroku" gem, and when I switch to it, using rvm, there is no problem using its "heroku" gem.
Since an rvm/osx installation can sometimes be "temperamental", or at least was in the past, I could really use some advice on what went wrong, and how I can I safely fix the broken gemset.
Thanks.
Gem netrc is dependency of heroku, run gem install heroku again to install all dependencies.
Remove heroku client if the above solution didn't work, I've solved the same problem with this:
rm -rf ~/.heroku/client
There was a bug in the updater in some earlier versions. I would recommend redownloading and reinstalling from https://toolbelt.heroku.com. After doing that you should have the latest version and update should work as expected as new versions continue to be released.
gem install heroku might not be enough in the event you had the heroku gem within a Gemfile of a specific project. I ran into this problem, and had to do a bundle update heroku. It just depends on what your project is using, a local gemset, or a global gemset. Of course, you want to make sure that your Gemfile doesn't have the heroku gem locked at a specific version, otherwise running an update will do nothing.

Heroku gem not working with RVM

I'm following the Ruby on Rails tutorial at http://railstutorial.org/chapters/beginning#sec:1.4.1, and all is going well until I tried to get my app going on Heroku.
I installed heroku, that worked fine, but now when I run heroku keys:add or any other heroku command, I get the following error:
/home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:9:in `rescue in <top (required)>':
no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:5:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rest-client-1.4.2/lib/rest_client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/lib/heroku/client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/lib/heroku.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/heroku-1.9.14/bin/heroku:6:in `<top (required)>'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin/heroku:19:in `load'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin/heroku:19:in `<main>'
I did what the error message said, and installed libopenssl-ruby, but heroku still didn't work.
I've done a search and found the following two pages which try to combat the heroku errors:
http://www.mail-archive.com/heroku#googlegroups.com/msg05001.html
http://blog.project-sierra.de/archives/1534
I followed the instructions on these pages (which are the same), but heroku still doesn't work.
I usually do my work on windows, so everything is a bit new to me on ubuntu. Here's my ruby environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial
- RUBY EXECUTABLE: /home/sirswap/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0#rails3tutorial
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I'm running ubuntu 10.04.
Any help or advice for next steps would be much appreciated :)
I experienced the same problem, and I think it was caused by not installing all the ruby dependencies listed when you run:
$rvm requirements # it was earlier: rvm notes
Specifically, I executed [be sure to install aptitude first]:
$sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
and after all that, I recompiled my ruby install (using $rvm reinstall 1.9.2) and heroku worked like a charm.
Hey :)
Don't know if it's still relevant or whether this will work for you as well.. it did for me.
Had the exact same problem..
I also noticed when doing
$ rails console
I was getting errors which indicated I had problems with Readline.
Following http://rvm.beginrescueend.com/packages/readline/ helped me fix all issues I was experiencing.
I blew many hours on this yesterday. Eventually, somewhat by chance (actually more like sheer desperation), I looked in the file /usr/bin/heroku
I noticed the first line of the script said
#!/usr/bin/env ruby1.9.1
I changed this to
#!/usr/bin/env ruby
and it started working. After re-installing ruby about 10 times and all that mucking around with openssl. rolleyes
I'm also doing the Railstutorial on Ubuntu 10.10 and got the exact same error while trying to add Heroku keys. This solves it:
$ rvm remove 1.9.2
$ rvm pkg install openssl
$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr
Read my directions on how to install RVM on Linux. You need to install libssl-dev or things like net/https won't work. It's OK though, just install that and recompile your rubies.
In your case "recompiling your rubies" can probably be done by issuing:
rvm install
Or alternatively you might make some progress by manually recompiling the openssl extension:
cd /home/sirswap/.rvm/src/ruby-1.9.2-p0/ext/openssl
ruby extconf.rb
make
make install
Please reinstall ruby. I was same problem and fixed by reinstalling ruby.
rvm reinstall ruby 1.9.2

Resources