I am trying to do the heroku setup portion of the tutorial http://ruby.railstutorial.org/. But on https://toolbelt.heroku.com/, I noticed there isn't an .rpm for Fedora, so I tried to install Foreman and the Heroku CLI individually. Foreman and Git installed fine, but I'm having trouble with the Heroku CLI.
When I try to do:
$yum install rubygem-heroku
and then subsequently do simply
$heroku
I get the error:
/usr/share/rubygems/rubygems/dependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [actionmailer-3.2.8, actionpack-3.2.8, activemodel-3.2.8, activerecord-3.2.8, activeresource-3.2.8, activesupport-3.2.8, addressable-2.3.2, arel-3.0.2, builder-3.0.4, builder-3.0.3, bundler-1.2.3, bundler-1.2.1, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.4.0, coffee-script-source-1.3.3, erubis-2.7.0, excon-0.16.10, execjs-1.4.0, foreman-0.60.2, heroku-api-0.3.7, hike-1.2.1, i18n-0.6.1, journey-1.0.4, jquery-rails-2.1.4, jquery-rails-2.1.3, jquery-rails-2.0.2, json-1.7.5, launchy-2.1.2, libv8-3.3.10.4-x86_64-linux, mail-2.4.4, mime-types-1.19, multi_json-1.5.0, multi_json-1.3.6, netrc-0.7.7, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.2, rails-3.2.8, railties-3.2.8, rake-10.0.3, rake-0.9.2.2, rdoc-3.12, rest-client-1.6.7, rubygems-bundler-1.1.0, rubyzip-0.9.9, rvm-1.11.3.5, sass-3.2.3, sass-3.2.1, sass-rails-3.2.5, sprockets-2.1.3, sqlite3-1.3.6, sqlite3-1.3.5, therubyracer-0.10.2, thor-0.16.0, tilt-1.3.3, treetop-1.4.12, treetop-1.4.11, treetop-1.4.10, tzinfo-0.3.35, tzinfo-0.3.33, uglifier-1.3.0, uglifier-1.2.3, uglifier-1.0.3] (Gem::LoadError)
from /usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
from /usr/share/rubygems/rubygems.rb:1231:in `gem'
from /usr/bin/heroku:18:in `<main>'
So I yum removed it and tried to instead do:
$rvmsudo gem install heroku
Now when I run heroku, I get:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- readline (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command/run.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:14:in `block in load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/cli.rb:27:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/heroku-2.33.5/bin/heroku:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/heroku:19:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/heroku:19:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `<main>'
Trying rvm info yields
ruby-1.9.3-p194#rails3tutorial2ndEd:
system:
uname: "Linux angelo 3.6.5-1.fc17.x86_64 #1 SMP Wed Oct 31 19:37:18 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
system: "redhat/17./x86_64"
bash: "/usr/bin/bash => GNU bash, version 4.2.37(1)-release (x86_64-redhat-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.16.6 (master) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "2 months 20 days 1 hour 33 minutes 52 seconds ago"
ruby:
interpreter: "ruby"
version: "1.9.3p194"
date: "2012-04-20"
platform: "x86_64-linux"
patchlevel: "2012-04-20 revision 35410"
full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd"
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/rake"
environment:
PATH: "/home/angelo/.rvm/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/angelo/heroku-client/:/home/angelo/.local/bin:/home/angelo/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd:/usr/local/rvm/gems/ruby-1.9.3-p194#global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: "rails3tutorial2ndEd"
And my rails version
$ rails -v
Rails 3.2.8
Gem env:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd
- RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd
- /usr/local/rvm/gems/ruby-1.9.3-p194#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I am pretty new to this whole ruby (as well as heroku), so I'm not sure what I should be looking for to match up, but everything seems to be ruby-1.9.3, so I am confused as to why Heroku doesn't want to cooperate.
There is also a stand alone version of the toolbelt now available at https://toolbelt.heroku.com/standalone.
I rather used the heroku and the foreman gem than using the heroku tool bet on fedora 17/18.
gem install heroku
gem install foreman
during installation it will give a warning saying
The heroku gem has been deprecated and replaced with the Heroku Toolbelt.
Ignore that. The toolbet even gave me problems on windows system.
All else works fine on Fedora 17/18.
Enjoy Rubying!
I did
sudo yum install rubygem-heroku
If you are using RVM, do this
rvm use system
use heroku client.
Had a hard time making heroku command work with rvm+jruby
You should totality go for the standalone option which is way more stable.
I had the gem installed as well and I got into a lot type of errors (ssl, cert, yours...)
You can go to:
https://toolbelt.heroku.com/standalone
and install it depending on your OS.
Hope this helps
If you install the rubygem_heroku package, it likely installs the gem in the system ruby.
Based on your examples, you're using RVM.
You should install the heroku gem directly into the RVM environment and gemset you want to use it in:
gem install heroku
Related
I was trying to setup a GitHub Page using Jekyll, which rely on Ruby (like here). Unfortunately, I think I kind of messed up with the installation (after a few sudo apt-get install ruby-full and sudo apt-get remove ruby-full ...)
Right now, I am stuck with an old version of Ruby (I think) on my computer that I am not able to update. Here is the state of my system right now:
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ gem -v
3.1.2
$ gem install jekyll
ERROR: Error installing jekyll:
The last version of sass-embedded (~> 1.54) to support your Ruby & RubyGems was 1.58.0. Try installing it with `gem install sass-embedded -v 1.58.0` and then running the current command again
sass-embedded requires RubyGems version >= 3.3.22. The current RubyGems version is 3.1.2. Try 'gem update --system' to update RubyGems itself.
$ gem update --system
Updating rubygems-update
Successfully installed rubygems-update-3.4.6
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.4.6
Traceback (most recent call last):
5: from setup.rb:22:in `<main>'
4: from setup.rb:22:in `require'
3: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `<top (required)>'
2: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `require'
1: from /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:49:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:50:in `<class:Specification>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
3: from setup.rb:22:in `<main>'
2: from setup.rb:22:in `require'
1: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1328:in `<top (required)>'
/home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1342:in `rescue in <top (required)>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
Loading the /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb file caused an error. This file is owned by your OS, not by rubygems upstream. Please find out which OS package this file belongs to and follow the guidelines from your OS to report the problem and ask for help.
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.7.0 (2019-12-25 patchlevel 0) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /home/jarret/gems
- USER INSTALLATION DIRECTORY: /home/jarret/.gem/ruby/2.7.0
- RUBY EXECUTABLE: /usr/bin/ruby2.7
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /home/jarret/gems/bin
- SPEC CACHE DIRECTORY: /home/jarret/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/jarret/gems
- /home/jarret/.gem/ruby/2.7.0
- /var/lib/gems/2.7.0
- /usr/lib/ruby/gems/2.7.0
- /usr/share/rubygems-integration/2.7.0
- /usr/share/rubygems-integration/all
- /usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/jarret/gems/bin
- /home/jarret/miniconda3/condabin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- /opt/fiji/Fiji.app
I've tried many remove/install, I've tried updated gem, ruby. Nothing unlocked me so far.
Try to replace ruby3.0, sass1.58 is too advanced and may not be compatible with ruby2.7.
Please follow these steps and run the command.
rvm install 3.0
rvm use 3.0.0 -default
rvm -v
rvm gemset update
gem install jekyll
jekyll -v
I tried to use Jekyll new command, but it didn't work and came out following errors.
$ jekyll new myblog
/Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:385:in `require_program': program version required (Commander::Runner::CommandError)
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `each'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:384:in `require_program'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/runner.rb:52:in `run!'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/delegates.rb:8:in `run!'
from /Library/Ruby/Gems/1.8/gems/commander-4.1.6/lib/commander/import.rb:10
from /usr/bin/jekyll:23
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require': no such file to load -- json (LoadError)
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/../lib/jekyll/filters.rb:2
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/../lib/jekyll.rb:44
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-1.4.3/bin/jekyll:7
from /usr/bin/jekyll:23:in `load'
from /usr/bin/jekyll:23
I'm using Mac OS X 10.8.5 Mountain Lion.
I checked stackoverflow and found a post which has a similar problem.
Error when running jekyll new command
Then I tried the below command.
$ sudo gem install json
but It didn't work for my situation. I uninstalled and reinstalled json but nothing happened.
Please let me know if you know any other solutions. I've been stuck on this problem since the beginning of the week...
my gem list & gem environment are as follows.
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.4)
blankslate (2.1.2.4)
classifier (1.3.4)
colorator (0.1)
commander (4.1.6)
fast-stemmer (1.0.2)
ffi (1.9.3)
highline (1.6.21)
io-console (0.4.2)
jekyll (1.4.3)
json (1.8.1)
liquid (2.5.5)
listen (1.3.1)
maruku (0.7.1)
minitest (4.7.5)
parslet (1.5.0)
posix-spawn (0.3.8)
psych (2.0.3)
pygments.rb (0.5.4)
rake (10.1.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
rb-kqueue (0.2.2)
rdoc (4.1.0)
redcarpet (2.3.0)
safe_yaml (0.9.7)
test-unit (2.1.1.0)
toml (0.1.1)
yajl-ruby (1.1.0)
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-darwin12.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.1.1/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.1.1/bin
- SPEC CACHE DIRECTORY: /Users/MyName/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0
- /Users/MyName/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/local/bin
- /usr/local/sbin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/git/bin
- /Users/MyName/.rvm/bin
Please give me advice to help me. Thank you!
Updated on Mar 7.
$ rvm list
rvm rubies
# No rvm rubies installed yet. Try 'rvm help install'.
Just in case you would like to see Homebrew list,
$ brew list
autoconf gmp4 libtool openssl readline
automake libgpg-error libyaml pkg-config ruby
cloog-ppl015 libksba llvm ppl011 ruby-build
gcc46 libmpc08 mpfr2 rbenv
2nd updated on Mar 7.
$ which ruby
/usr/local/bin/ruby
$ which jekyll
/usr/bin/jekyll
$ ruby --version
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
$ echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/MyName/.rvm/bin
I remember that my mac had been installed Ruby 1.8.7 before I installed 2.1.1p76.
It looks like you have multiple versions of Ruby on your system (1.8.7 and 2.1.1), which is very common, and part of the reason tools like rvm and rbenv were created. The issue is that when you did gem install jekyll (maybe with a sudo) and sudo gem install json, these seem to have ended up in different spots and aren't finding each other. The /usr/local/bin location is typically where Homebrew puts things (hence, you have ruby listed under brew list) and this is your Ruby 2.1.1 location. However, your jekyll installation is under the location of the Apple-installed Ruby 1.8.7.
Step 1: try gem uninstall jekyll, then gem install jekyll. This should fix your problems.
Step 2: If that doesn't work, try to use rbenv or rvm to select a different version of Ruby, then try Step 1 again.
For example, my installations are here (managed via rvm):
$ which jekyll
/Users/nicksuch/.rvm/gems/ruby-2.0.0-p247/bin/jekyll
$ which gem
/Users/nicksuch/.rvm/rubies/ruby-2.0.0-p247/bin/gem
$ which ruby
/Users/nicksuch/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
In my case the Jekyll template suggested to use bundle utility as:
bundle exec jekyll build
The solution was to include json into Gemfile (which was already part of the sources):
diff --git a/Gemfile b/Gemfile
index 98b29af..b8537cf 100644
--- a/Gemfile
+++ b/Gemfile
## -1,7 +1,8 ##
source "https://rubygems.org"
+gem "json"
gem "jekyll", "~> 3.0"
gem "jekyll-sitemap"
DETAILS
What lead me to the solution was the following fact:
command gem list json showed json gem installed;
but command bundle exec gem list json didn't show anything.
I also tried to run bundle exec gem install json - it didn't work. My best guess was that bundle sets up the environment for a single run based on Gemfile which is the only way to make set of dependencies persistent across each bundle exec ... executions.
I'm starting to play with Heroku to deploy a simple Node.js in their free plan. But when I run foreman start, I see this error :
/Library/Ruby/Site/1.8/rubygems/builder.rb:10: undefined method `load_yaml' for Gem:Module (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1110:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1110
from /usr/local/foreman/lib/foreman/process.rb:2:in `require'
from /usr/local/foreman/lib/foreman/process.rb:2
from /usr/local/foreman/lib/foreman/engine.rb:3:in `require'
from /usr/local/foreman/lib/foreman/engine.rb:3
from /usr/local/foreman/lib/foreman/cli.rb:3:in `require'
from /usr/local/foreman/lib/foreman/cli.rb:3
from /usr/bin/foreman:13:in `require'
from /usr/bin/foreman:13
Problem : I know close to nothing to the Ruby platform, I don't use. I just happened to have rvm installed on my machine because I once wanted to play Octopress (Blog generator based on Jekyll). I first searched the internet, but couldn't find anything. I also visited the official RVM site and followed the troubleshooting basic steps : I ran rvm stable (which just produced no output...), ensured the call to the RVM script came last in my ~/.bash_profile, and yes I'm using bash.
Here's the info I can give so you can help me.
I'm under OS X 10.6.8.
rvm list prints :
rvm rubies
=> ruby-1.9.2-p290 [ x86_64 ]
which ruby prints :
/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
rvm info prints :
ruby-1.9.2-p290:
system:
uname: "Darwin djebbz 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.8.3 by Wayne E. Seguin (wayneeseguin#gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.9.2p290"
date: "2011-07-09"
platform: "x86_64-darwin10.8.0"
patchlevel: "2011-07-09 revision 32553"
full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]"
homes:
gem: "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290"
ruby: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290"
binaries:
ruby: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
irb: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
gem: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
rake: "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290/bin/rake"
environment:
PATH: "/Users/khalid_jebbari/.gem/ruby/1.8/bin:/usr/local/heroku/bin:/Users/khalid_jebbari/bin/bin:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290/bin:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290#global/bin:/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/khalid_jebbari/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin"
GEM_HOME: "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290"
GEM_PATH: "/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290:/Users/khalid_jebbari/.rvm/gems/ruby-1.9.2-p290#global"
MY_RUBY_HOME: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290"
IRBRC: "/Users/khalid_jebbari/.rvm/rubies/ruby-1.9.2-p290/.irbrc"
RUBYOPT: ""
gemset: ""
PATH is not set properly, my guess is you reset or preset PATH, use ruby to make it working:
rvm use 1.9.2-p290
and install foreman:
gem install foreman
Why am I receiving this Rake error:
$ rake --version
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError)
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake:18:in `<main>'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
given that the following is the case:
$ gem list
*** LOCAL GEMS ***
bundler (1.1.3)
rake (0.9.2.2)
rubygems-bundler (1.0.2)
rvm (1.11.3.3)
$ which rake
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake
Specifically: is this error message stemming from a bug, or from a configuration problem (and if the latter, then which steps might remedy it)?
Update: additional terminal output as requested:
$ which gem
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/gem
$ whereis rake
/usr/bin/rake
$ echo $PATH # I've edited the output as one item per line for easier reading
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin:
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global/bin:
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin:
/Volumes/Data/sampablokuper/.rvm/bin:
/opt/local/bin:
/opt/local/sbin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/texbin:
/usr/X11/bin:
/usr/local/git/bin:
/Library/Application Support/VMware Fusion:
/Volumes/Data/sampablokuper/bin:
/Volumes/Data/sampablokuper/.rvm/bin
$ type rvm | head -n1
rvm is a function
$ rvm info
ruby-1.9.3-p194:
system:
uname: "Darwin spksmb.lan 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.14.3 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "9 hours 36 minutes 53 seconds ago"
ruby:
interpreter: "ruby"
version: "1.9.3p194"
date: "2012-04-20"
platform: "x86_64-darwin10.8.0"
patchlevel: "2012-04-20 revision 35410"
full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]"
homes:
gem: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194"
ruby: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194"
binaries:
ruby: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake"
environment:
PATH: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin:/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global/bin:/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin:/Volumes/Data/sampablokuper/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/local/git/bin:/Library/Application Support/VMware Fusion:/Volumes/Data/sampablokuper/bin"
GEM_HOME: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194"
GEM_PATH: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194:/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global"
MY_RUBY_HOME: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: ""
The 'whereis' binary checks a set of system default paths set by the user.cs_path variable (see sysctl -a | grep user.cs_path) and NOT the actual $PATH variable. So the 'rake' location reported will always be whatever happens to be in that set of paths and not the actual one in use, unless that truly does happen to be the only rake installed on the system and thus not showing up in $PATH.
Please run
which rake
to see which rake is actually being used. If it reports /usr/bin/rake and not some path such as /Users/me/.rvm/gems/ruby-1.9.3-p194#global/bin/rake then definitely something is wrong.
Please include
rvm info
output and make sure that
type rvm | head -n1
reports "rvm is a function". If it is reporting anything other than that, your install is messed up, in which case you should remove your rvm install using rvm implode, logging out completely, and then doing a complete reinstall of RVM. Yes, the logout step is important.
It looks as though the problem was occurring because of the presence, in the directory from which I was executing the commands shown in the question, of a file called Gemfile with the following contents:
source 'https://rubygems.org'
gemspec
Deleting or renaming that file yields the following (yay!):
$ rake --version
rake, version 0.9.2.2
By contrast, keeping the Gemfile, but deleting or renaming the myproject.gemspec file from the directory yields this:
$ rake --version
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/dsl.rb:48:in `gemspec': There are no gemspecs at /Volumes/Data/spikes/myproject. (Bundler::InvalidOption)
from /Volumes/Data/spikes/myproject/Gemfile:4:in `evaluate'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/dsl.rb:7:in `instance_eval'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/dsl.rb:7:in `evaluate'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/definition.rb:18:in `build'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler.rb:135:in `definition'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler.rb:123:in `load'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'
The fact that the behaviour of rake --version is so strongly influenced by the presence/absence/contents of these files does strike me as a bug, and I'll be filing a bug report accordingly.
I use sudo to install gems and update rubygems itself but this causes the problem of all new files in /usr/lib/ruby/gems/1.8/gems to be owned by root:root with a permission of 750
This in turn causes most gems to fail to load.
For example, I recently updated rubygems and if I try gem env I get:
/usr/local/lib/site_ruby/1.8/rubygems/specification.rb:512:in `read': Permission denied - /usr/lib/ruby/gems/1.8/specifications/rubygems-update-1.6.2.gemspec (Errno::EACCES)
from /usr/local/lib/site_ruby/1.8/rubygems/specification.rb:512:in `load'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:116:in `load_gems_in'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:115:in `each'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:115:in `load_gems_in'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:112:in `reverse_each'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:112:in `load_gems_in'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:309:in `refresh!'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:67:in `from_gems_in'
from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:47:in `from_installed_gems'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1025:in `source_index'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:135:in `init_gemspecs'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_path_searcher.rb:14:in `initialize'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:984:in `new'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:984:in `searcher'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:206:in `try_activate'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:57:in `require'
from /usr/local/lib/site_ruby/1.8/rubygems/config_file.rb:55
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:8
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/bin/gem:9
The current workaround is to chmod all files to be readable by everyone but this is getting really annoying.
Some server stats:
uname -a gives
Linux HomeBox 2.6.35 28-server #49-Ubuntu SMP Tue Mar 1 14:55:37 UTC 2011 x86_64 GNU/Linux
sudo gem env gives
RubyGems Environment:
- RUBYGEMS VERSION: 1.6.2
- RUBY VERSION: 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/nicklas/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
ruby -v gives
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
I'd be happy to provide more info on the problem.
Update
I just cleaned out all ruby and rubygems stuff and reinstalled it. Same problem.
I use Ubuntu at home too, and after many problems with using apt to install, I discovered RVM.
RVM is super-simple to install, and gets you up and running quickly and easily. But once you start using it for a while, you'll discover that it is superior to any OS package system because it has features that allow you to:
Install multiple versions of Ruby and JRuby and easily switch between them. I can just issue rvm use 1.9.2 or rvm use jruby-1.6.2 and my path is switched automatically and everthing just works.
Install sets of gems into "gemsets" which allow you to use the same gems across multiple ruby versions, so you don't have to manually reinstall. Also, you can switch between gemsets so you can isolate experimental gem versions, etc.
My recommendation is to uninstall the native ruby package, and install RVM. You'll be glad you did.