I have been attempting to install the httparty gem, but the install fails with:
Error installing httparty:
httparty requires Ruby version >=1.9.3
My ruby version, from running ruby -v, is 1.9.3p448
Running gem env yields:
RUBYGEMS VERSION: 2.0.7
RUBY VERSION: 1.9.3
INSTALLATION DIRECTORY: .../ruby 1.9.3-p448/bin/ruby
RUBY EXECUTABLE: .../ruby-1.9.3-p448/bin
GEM PATHS:
.../gems/ruby-1.9.3-p448
.../ruby-1.8.3-p448#global
Any ideas why this is failing & what i can to to fix it, short of manually editing the gem to remove the 1.9.3 requirement?
This seems to me like it isn't using Ruby 1.9.3 as that is exactly what the error says. I had the same error message today when pushing to Heroku:
Installing httparty (0.12.0)
Gem::InstallError: httparty requires Ruby version >= 1.9.3.
An error occurred while installing httparty (0.12.0), and Bundler cannot
continue.
Make sure that `gem install httparty -v '0.12.0'` succeeds before bundling.
I just added
ruby '1.9.3'
to the top of my Gemfile like so:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.0.20'
and all is well.
Related
My current rails application has been built on ruby 1.9.3 and rails 3. I am doing bundle install one of the rails engines and I am received following error
Gem::InstallError: nokogiri requires Ruby version >= 2.1.0.
An error occurred while installing nokogiri (1.8.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.2'` succeeds before bundling.
How I can get rid of this issue without updating ruby version.
You need to install the compatible version of nokogiri with ruby version 1.9.3
gem 'nokogiri', '~> 1.6', '>= 1.6.8.1' in your Gemfile.
But note, that Ruby versions below 2.1 are no longer maintained and no longer supported by nokogiri.
hope it will help you out
UPDATE1.
Added the line ruby '2.4.0' to my Gemfile and now the bundler complains about old ruby version:
$ bundle
Your Ruby version is 1.8.7, but your Gemfile specified 2.4.0
However:
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin12.0]
So it looks like bundler is using my old ruby version that was originally installed by the OSX, instead of the new one that I installed via homebrew.
Is there any way to tell the bundler to use the new ruby?
UPDATE.
I have changed line 3 of Gemfile as suggested in the answer by Sachin Singh, unfortunately that leads to further errors:
...
Installing i18n (0.7.0)
Gem::InstallError: i18n requires Ruby version >= 1.9.3.
An error occurred while installing i18n (0.7.0), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.
The installation gem install i18n -v '0.7.0' goes without errors but the problem persists.
I am trying to setup Parse Docs locally but
$ bundle install
leads to this error:
Gemfile syntax error:
/Users/dmitrizaitsev/Repos/Parse-Docs/Gemfile:3: syntax error, unexpected ':', expecting $end
gem 'github-pages', group: :jekyll_plugins
^
My Ruby version is 2.4:
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin12.0]
Their Gemfile:
source 'https://rubygems.org'
gem 'jekyll', '>=3.1.6'
gem 'github-pages', group: :jekyll_plugins
gem 'jekyll-redirect-from', '0.10.0'
Any idea what is wrong here?
May be its a ruby version issue, you can try this:
ruby '2.4.0'
source 'https://rubygems.org'
gem 'jekyll', '>=3.1.6'
gem 'github-pages', :group => 'jekyll_plugins'
gem 'jekyll-redirect-from', '0.10.0'
When running a script containing the following
require 'rubygems'
require 'zip'
I am getting
`require': cannot load such file -- zip
First I have tried to install like this 'rubyzip'
gem install rubyzip
When looking at the gem env:
>gem env
RubyGems Environment:
RUBYGEMS VERSION: 2.4.8
RUBY VERSION: 2.2.3 (2016-01-26 patchlevel 0) [java]
INSTALLATION DIRECTORY: C:/jruby-9.0.5.0/lib/ruby/gems/shared
RUBY EXECUTABLE: C:/jruby-9.0.5.0/bin/jruby.exe
EXECUTABLE DIRECTORY: C:/jruby-9.0.5.0/bin
SPEC CACHE DIRECTORY: C:/Users/lucio/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: C:/jruby-9.0.5.0/etc
RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
GEM PATHS:
- C:/jruby-9.0.5.0/lib/ruby/gems/shared
- C:/Users/lucio/.gem/jruby/2.2.0
in the irb seems like the require works
irb(main):001:0> require 'zip'
=> true
I also trying to install with bundler after installing
>bundle show
Gems included by the bundle:
* bundler (1.12.4)
* rubyzip (1.2.0)
but when running my script I get
>bundler exec ruby zip.rb
Could not find rubyzip-1.2.0 in any of the sources
Run `bundle install` to install missing gems.
I can also see it in the gem list
>gem list -l
*** LOCAL GEMS ***
bundler (1.12.4)
jar-dependencies (0.2.3)
jruby-openssl (0.9.15 java)
jruby-win32ole (0.8.5)
json (1.8.0 java)
minitest (5.4.1)
power_assert (0.2.3)
psych (2.0.15 java)
racc (1.4.13 java)
rake (10.1.0)
rdoc (4.1.2)
rubygems-update (2.6.4)
rubyzip (1.2.0)
Can anybody help ?
Found the problem.
I had Jruby installed along with Ruby, so when installing the gem it will automatically install under the Jruby directory and later won't be found by Ruby removing the Jruby from PATH end variable solved the problem
I'm working on a Ruby script, it's not a web or Rails app. It's working well locally with Capybara and PhantomJS but I don't know how to run it after pushing to a Ruby 2.0 app in Openshift.
I ssh to app-root/repo and tried bundle install --without development, but it outputs:
Gem::InstallError: mime-types requires Ruby version >= 1.9.2.
An error occurred while installing mime-types (2.99), and Bundler cannot continue.
Make sure that `gem install mime-types -v '2.99'` succeeds before bundling.
Gemfile is:
source "https://rubygems.org"
gem "capybara"
gem "poltergeist"
gem "mailgun"
group :development do
gem "selenium-webdriver"
gem "chromedriver-helper"
gem "launchy"
end
Gemfile.lock was generated locally and pushed. Local Ruby is RVM 2.0, on Ubuntu 14.04 LTS.
It's most likely something simple but I've never used Openshift. Does anyone have any ideas?
ruby -v is ruby 2.0.0p645 (2015-04-13) [x86_64-linux].
which ruby is /opt/rh/ruby200/root/usr/bin/ruby.
which bundler is /usr/bin/bundler.
I have install rbev
rbenv version
2.0.0-p247 (set by /Users/amritdeepdhungana/.rbenv/version)
, ruby
ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]\
and rails
rails -v
Rails 4.0.1
I have create new project and bundle it. But I get this problem
Installing rake (10.1.1)
Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/build_info/rake-10.1.1.info
An error occurred while installing rake (10.1.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.1'` succeeds before bundling.
After that, I have install rake gem but again I got error
gem install rake -v '10.1.1'
ERROR: Could not find a valid gem 'rake' (= 10.1.1), here is why:
Unable to download data from https://rubygems.org/ - too many connection resets (https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz)
ERROR: Possible alternatives: rake
How can I set the permission while install any gem package ?
Like #bjhaid said, you're trying to install these gems into your system Ruby.
/Library/Ruby/Gems/2.0.0/build_info/rake-10.1.1.info
Ruby 2.0.0p247 is bundled w/Mavericks. Specifically:
$ /usr/bin/ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
My self-built (rvm) version is has a slightly different version string:
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
To find out which ruby is actually being used, try which ruby. Make sure you've properly installed rbenv, and installed a new local Ruby.
It almost looks like you haven't set your PATH up correctly, but your answer to Nick Veys' question doesn't look like it. I would surmise that you haven't installed any ruby under rbenv yet. What does rbenv versions look like?