Modify batch files to make rails use newer version of ruby? -
would sufficient modify existing batch files reference path rails's ruby.exe, or, missing bigger picture?
windows 7 os, running rails s
project folder warning:
rubydep: warning: ruby is: 2.2.4 (buggy). recommendation: install 2.2.5 or 2.3.1.
using rails installer, have rails 4.2.5.1 installed here:
c:\railsinstaller
, older version of ruby, here:
c:\railsinstaller\ruby2.2.0\bin\ruby.exe
...specifically
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
i have ruby 2.3.1 installed:
c:\ruby23-x64\bin\ruby.exe
specifically
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
i've updated path c:\ruby23-x64\bin;
has precedence rails still invokes version 2.2.4 c:\railsinstaller\ruby2.2.0\bin\ruby.exe
when invoke rails s
.
in rails project i've specified ruby "2.3.1" in
c:\users\user_name\rails_project.ruby-version
also, if add ruby '2.3.1'
project gemfile, error msg , : your ruby version 2.2.4, gemfile specified 2.3.1
i assuming can't replace 2.2 ruby.exe 2.3 ruby.exe? (or enclosing folders , contents...)
as understand, neither rvm (per faq, resounding "no" - of 2012 cygwin env might option?) nor rbenv (per mischa taylor, suggestion use pik ) nor pik(per readme, "no longer maintained") available windows 7.
would sufficient , adequate modify existing batch files reference path rails's ruby.exe? example, change each of bat_file_name.bat files in c:\railsinstaller\ruby2.2.0\bin\ directory read:
@echo off if not "%~f0" == "~f0" goto :winnt @"c:\railsinstaller\ruby2.2.0\bin\ruby.exe" "c:/railsinstaller/ruby2.2.0/bin/bat_file_name" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto :eof :winnt @"c:\railsinstaller\ruby2.2.0\bin\ruby.exe" "%~dpn0" %*
...to:
@echo off if not "%~f0" == "~f0" goto :winnt @"c:\ruby23-x64\bin\ruby.exe" "c:/railsinstaller/ruby2.2.0/bin/bat_file_name" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto :eof :winnt @"c:\ruby23-x64\bin\ruby.exe" "%~dpn0" %*
i notice slashes ( \ , / )are reversed "c" railsinstaller lowercase, similar how git bash app displays/uses drive names. don't pretent understand how works, maybe swapping in "c:/ruby23-x64/bin/ruby.exe"?
so maybe this:
@echo off if not "%~f0" == "~f0" goto :winnt @"c:/ruby23-x64/bin/ruby.exe" "c:/railsinstaller/ruby2.2.0/bin/bat_file_name" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto :eof :winnt @"c:/ruby23-x64/bin/ruby.exe" "%~dpn0" %*
apologies if off-topic can't afford mac , i've tried setting rails on ubuntu , run similar problems. of note, have basic bare bones project working on win7 not note "buggy" version, defaults old version of ruby. @ least rails server run using version of ruby tell to. thanks!
Comments
Post a Comment