Note: At the time of writing this the commands shown below were executed on Ubuntu 14.04
-
Updated
.ruby-versionby replacing2.2.1WITH2.2.3. In case this file is not present, its better to create it. -
Updated
.ruby-gemsetby replacing<MY_APP_NAME>WITH<MY_APP_NAME>-on-rails-5, where<MY_APP_NAME>represents your app's name. In case this file is not present, its better to create it. -
Upgraded
rvmby running command$ rvm get stable. -
Installed latest stable Ruby version listed here using command:
$ rvm install 2.2.3 -
Removed
Gemfile.lock -
Updated
Gemfileby replacinggem 'rails', '4.2.0'WITHgem 'rails', git: 'https://github.com/rails/rails.git' -
Installed
bundlerusing command:$ gem install bundler -
Ran
bundleand encountered error:``` Bundler could not find compatible versions for gem "rack": In Gemfile: rails (>= 0) ruby depends on actionpack (= 5.0.0.alpha) ruby depends on rack (~> 2.x) ruby Could not find gem 'rack (~> 2.x) ruby', which is required by gem 'actionpack (= 5.0.0.alpha) ruby', in any of the sources. ``` Found following references on this error: https://github.com/rails/rails/issues/21422 -
Based on the reference found to get rid of the error shown above, added following to the Gemfile.
``` # ================================ # Once Rails 5 is officially released I don't think the following shall be needed. But for # now those are required to get rid of error reported in https://github.com/rails/rails/issues/21422 gem 'rack', :git => 'https://github.com/rack/rack.git' gem 'arel', :git => 'https://github.com/rails/arel.git' # ================================ ```Reference: http://www.christopherbloom.com/2015/04/26/setting-up-a-rails-5-app-from-edge/
-
Ran
bundleand encountered following error:``` Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /home/jignesh/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151119-12203-hjmfyi.rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.so /usr/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status make: *** [generator.so] Error 1 make failed, exit code 2 Gem files will remain installed in /home/jignesh/.rvm/gems/ruby-2.2.3@<GEMSET_NAME>/gems/json-1.8.3 for inspection. Results logged to /home/jignesh/.rvm/gems/ruby-2.2.3@<GEMSET_NAME>/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out An error occurred while installing json (1.8.3), and Bundler cannot continue. Make sure that `gem install json -v '1.8.3'` succeeds before bundling. ``` Found following reference on this error: http://stackoverflow.com/questions/32130649/can-not-install-json-gem-with-ruby-2-2-3-on-ubuntu -
Based on the reference found to get rid of the error shown above, ran following:
$ sudo apt-get install libgmp3-devReference: http://stackoverflow.com/a/32191707/936494 -
Ran
bundleagain and it ran successfully!