I'm using Linux Mint. I've already installed jruby and jdk.
When I check ruby version it gives me correct message
ruby -v
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) Server VM 1.8.0_05-b13 +indy [linux-i386]
But when I try to install some gems like this:
gem install bundler
It gives me this message:
ERROR: While executing gem ... (SocketError)
recv: name or service not known
which jruby
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/jruby
which gem
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/gem
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 1.9.3 (2014-02-24 patchlevel 392) [java]
- INSTALLATION DIRECTORY: /home/msdc/.rvm/gems/jruby-1.7.11
- RUBY EXECUTABLE: /home/msdc/.rvm/rubies/jruby-1.7.11/bin/jruby
- EXECUTABLE DIRECTORY: /home/msdc/.rvm/gems/jruby-1.7.11/bin
- SPEC CACHE DIRECTORY: /home/msdc/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.8
- GEM PATHS:
- /home/msdc/.rvm/gems/jruby-1.7.11
- /home/msdc/.rvm/gems/jruby-1.7.11@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/msdc/.rvm/gems/jruby-1.7.11/bin
- /home/msdc/.rvm/gems/jruby-1.7.11@global/bin
- /home/msdc/.rvm/rubies/jruby-1.7.11/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/jre/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/bin
- /home/msdc/bin
- /usr/local/java/jdk1.8.0_05/jre/bin
- /home/msdc/.rvm/bin
When I run gem install bundler
in debug mode it gives me this:
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:775:in `recv_reply'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:663:in `request'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:511:in `each_resource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:0:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1026:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1025:in `resolv'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:1023:in `resolv'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:503:in `each_resource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/1.9/resolv.rb:480:in `getresource'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/remote_fetcher.rb:88:in `api_endpoint'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source.rb:42:in `api_uri'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source.rb:170:in `load_specs'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:265:in `tuples_for'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:226:in `available_specs'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/source_list.rb:97:in `each_source'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:222:in `available_specs'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:216:in `find_gems_with_sources'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:292:in `find_spec_by_name_and_version'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:166:in `available_set_for'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:418:in `resolve_dependencies'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/dependency_installer.rb:371:in `install'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:219:in `install_gem'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:263:in `install_gems'
org/jruby/RubyArray.java:1613:in `each'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:259:in `install_gems'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/commands/install_command.rb:171:in `execute'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command.rb:305:in `invoke_with_build_args'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command_manager.rb:167:in `process_args'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/command_manager.rb:137:in `run'
/home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/gem_runner.rb:54:in `run'
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/jgem:21:in `(root)'
org/jruby/RubyKernel.java:1101:in `load'
/home/msdc/.rvm/rubies/jruby-1.7.11/bin/gem:4:in `(root)'
Exception `Gem::SystemExitException' at /home/msdc/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/user_interaction.rb:381 - Exiting RubyGems with exit_code 1
export JAVA_HOME=/opt/java/7/home
) – karesERROR: While executing gem ... (SocketError) recv: name or service not known
– Milos DolobacResolv
's source and making sure code such asSocket.gethostbyname("rubygems.org")
works (in irb) first. – kares["ec2-54-245-255-174.us-west-2.compute.amazonaws.com", [], 2, "6\xF5\xFF\xAE"]
– Milos Dolobac