Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows RailsInstaller for Rails 4.2 and Ruby 2.2 still broken? #81

Open
edactic opened this issue May 2, 2016 · 15 comments
Open

Windows RailsInstaller for Rails 4.2 and Ruby 2.2 still broken? #81

edactic opened this issue May 2, 2016 · 15 comments

Comments

@edactic
Copy link

edactic commented May 2, 2016

I just downloaded and tried RailsInstaller for Rails 4.2 and Ruby 2.2 from installRails.com. Things appear to install correctly but the paths to the executables are still apparently corrupt. No changes were made to the Windows PATH configuration, and so nothing works the way it should. Can't run ruby, rails, or git, to name the top three. (Well, not completely true. I can run Ruby if I manually go to C:\RailsInstaller\Ruby2.2.0\bin). When I look at paths in some batch files, I see things like: "C:\Users\emachnic\GitRepos..." as if hard-coded paths were randomly left in place by the developer. At least 2 months have passed since a bunch of threads were posted about problems like this and apparently still no fixes. Quite a disappointment and not a good way to convert a developer to Rails as a viable platform.

@margaretcsmith
Copy link

Hi,
I still can't install Rails on my Windows machine. Any news on when the fix will be ready?
Thanks,
M

@Seally
Copy link

Seally commented Jun 18, 2016

Just change the paths in those files to the correct path. Going by the pattern, a simple replace all by a text editor that can see the entire tree (e.g. Sublime, Atom, most IDEs) should be able to solve most of these issues. This has been reported (and closed) already: #73

There are a lot of path mistakes in RailsInstaller though. I agree that this should be fixed in later versions.

@margaretcsmith
Copy link

Thanks very much. It worked.

@josephgodwinkimani
Copy link

josephgodwinkimani commented Jun 22, 2016

Just to make it clear - the files to edit are all gem BAT files in %HOMEDRIVE%\RailsInstaller\Ruby2.2.0\bin or wherever your RailsInstaller installation is situated cd down to bin directory of your Ruby installation: bundle, bundler, compass, erb, erubis, gem, irb, rails, sass, tilt, sqlite3_ruby, thor, nokogiri.

It is advisable to change the rails.bat file first since some of the other gem files are rails dependencies (irb, rake etc) you will notice most of them were change when you test rails -v immediately after editing rails.bat.

Do not tamper with publickey.bat unless you know what you are doing.

@margaretcsmith
Copy link

Hi,
Apparently, I had some syntax errors when I tried to correct the various files involved. I finally found an easy way to correct the issue. In Powershell, I execute this command to overwrite the previous installation: "gem install rails" . Now when I enter "rails -v", it finds the path. Voila!
Thanks for everyone's help.

@sebesbal
Copy link

It's ridiculous that bug is still there... (hard coded paths to the developer's machine...???) Give me back my 20 minutes!

@mchuang484
Copy link

Thanks margaretcsmith. "gem install rails" solved my installation issue.

@ashmaroli
Copy link

After successful installation of Railsinstaller, open the bundled version of command-prompt and simply run gem update --system to update rubygems version.
Then run gem update --no-document to update all installed gems in PATH. This will update associated executables, .bat files and .cmd files in the /bin folder

@wpostma
Copy link

wpostma commented Oct 3, 2016

How can I contribute and get the out of box installation experience fixed? Some developer who knows, please tell me.

This is silly that it's been broken from March (see google groups) to October of 2016. That's 8 months.

I'm new to ruby but I know a bad batch file when I see one.

Maybe the MR should be "run gem update --system" and "gem update --no-document" when the install completes, and maybe the MR should be to drop these broken and outdated ruby binaries from ruby installer and actually just have the ruby installer do "gem install rails"

@gptura
Copy link

gptura commented Nov 2, 2016

Yup confirmed. Did a fresh install just now and its still broken. I did try changing the paths of some batch files as what the others have mentioned but did not work for me.

image

image

Will probably continue using a cloud IDE for now. I hope the developers would see and resolve this pretty soon. Thanks!

@gptura
Copy link

gptura commented Nov 2, 2016

My issues in installing rails got resolved using the guide on this website.

http://installrails.com/

@ashmaroli
Copy link

alternatively, simply run the following to have the latest versions of all installed gems:

gem update --system && gem update --no-document

@williaba
Copy link

williaba commented Dec 3, 2016

@ashmaroli thank you so much, "gem update --no-document" worked for me!

kemenaran added a commit to kemenaran/railsinstaller-windows that referenced this issue Dec 17, 2016
Since rubygems v2.4.2, Windows binstubs for gem executables
are generated with a hardcoded path to Ruby. This leads to
the binstubs shipping with RailsInstaller-Windows being
unusable, because they reference the Ruby path on the maintainer
machine, rather than the machine that executed the installer
(see railsinstaller#81).

This is due to a fix in rubygems, which explicitely hardcodes
the Ruby path in the binstubs, to work around a Bundler issue
(see rubygems/rubygems#942).

The author of the patch notes that it makes Ruby installations
non-portable across machines - which is exacly the issue that
we encounter there. The intended workaround for people needing
portable installations is to re-generate the binstubs locally,
by executing `gem pristine --all --executables-only`.

This is how this PR implements the fix: it simply re-generates
the binstubs with the correct path at the end of the
installation.

In the future, I may attempt to fix the issue upstream in
rubygems, by allowing `--env-shebang` to generate a portable
Ruby path again, as it was suggested in the original pull
request.
@MichelleBruegger
Copy link

The bug with the wrong paths in different batchfiles has not been corrected with Railsinstaller-3.3.0.exe

First step was: install until the "Completing the RailsInstaller Setup Wizard" was shown. Don't click on "Finish" yet.

Do what @margaretcsmith commented on 25 Jun 2016.
Then do what @ashmaroli commented on 14 Aug 2016

After that I changed config_check.rb (located on C:\RailsInstaller\scripts) line 78 and line 82, because they referred to a wrong railsinstaller_path (2.0.0 instead of Ruby2.3.0")

Then I clicked on "Finish" on the RailsInstaller-Setup with activated "Configure git and ssh when installation has completed."

And... it worked 👍

@emachnic
Copy link
Contributor

Please try with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests