Owen
Owen

Reputation: 361

why won't RVM (Ruby Version Manager) install?

So my goal is to upgrade Rails from 5.0.6 to the newest version on Windows 10 in order to follow a tutorial that uses it. If I understand correctly then i need to install RVM in order to upgrade my Rails version. from the RVM site https://rvm.io/rvm/install the first command to install it is:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BD

however i get the following error:

'gpg' is not recognized as an internal or external command,
operable program or batch file.

so my question is, do i need to install the RVM and if so how can i proceed?

if I upgrade to Rails 5.1.5 will the apps i made with my 5.0.6 be backwards compatible and still work on my machine or will they break? I am quite confused as to the issue of upgrading since all the videos and articles on upgrading seem to deal with upgrading individual apps and not the actual Rails software itself.

EDIT 1: added gemfile

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

ruby '2.2.6'
gem 'rails', '~> 5.1.2'

# Rails defaults
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end
group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# learn-rails
gem 'bootstrap-sass'
gem 'gibbon'
gem 'high_voltage'
gem 'jquery-rails'
group :development do
  gem 'better_errors'
  gem 'rails_layout'
end
group :development, :test do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
end
group :test do
  gem 'minitest-spec-rails'
end

now rails server wont start wıth error:

C:\Sites\learn-rails>rails s
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.14.5/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:145:in `block in full_require_paths'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:144:in `map'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:144:in `full_require_paths'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:77:in `contains_requirable_file?'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:949:in `block in find_in_unresolved'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:949:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:949:in `find_all'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:949:in `find_in_unresolved'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:74:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.14.5/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.14.5/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:145:in `block in full_require_paths'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:144:in `map'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/basic_specification.rb:144:in `full_require_paths'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:1370:in `add_self_to_load_path'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/specification.rb:1283:in `activate'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
        from C:/Sites/learn-rails/bin/spring:14:in `<top (required)>'
        from bin/rails:3:in `load'
        from bin/rails:3:in `<main>'

Upvotes: 0

Views: 745

Answers (2)

magynhard
magynhard

Reputation: 238

As already stated, you do not need to install RVM, but it can be very useful if you have several Ruby projects, using different ruby versions.

Unfortunately, RVM was originally only available for POSIX systems like Linux or Mac.

As i was unhappy with that, i created a clone of RVM, called rvm-windows, with its basic features for Windows: https://github.com/magynhard/rvm-windows

Upvotes: 0

jon1467
jon1467

Reputation: 89

You don't have to have a Ruby version manager (like RVM) to use Rails, but it is recommended if you're going to be working on multiple projects. Similar to the way Gemfiles keep everyone in sync using the same gems, a Ruby version manager can help ensure that everyone is using the same version of Ruby, too.

The main complication here is that you're using Windows, which RVM does not support. You either need to use something like cgywin, or try out Ubuntu on Windows, if you want to use RVM.

Alternatively, you could try a Windows-native tool, like Uru.

You can continue without using RVM or any other version manager, and upgrading to 5.1 is unlikely to give you any issues if 5.0 was already working smoothly for you.

Upvotes: 1

Related Questions