0

I am following a tutorial for using Ruby and Sinatra.

I am using Windows 10. I downloaded RailsInstaller and I was following a section where I need to install the gems coffee-script and therubyracer. coffee-script installed but not therubyracer, I get an error like this... 'therubyracer' error installation image

I tried to install the gem libv8 but that didn't work for me either. I get this error... 'libv8' error installation image

How can I resolve these errors and install therubyracer on Windows 10?

anothermh
  • 9,815
  • 3
  • 33
  • 52
JHero23
  • 149
  • 3
  • 10
  • In order to be traceable online you need to add the errors inside the question, not as an image. – Jeroen Heier Dec 19 '18 at 04:58
  • One of the dependencies listed in your error message for therubyracer is python2 (you have python3 installed it says). You should try installing python2 and then try to re-install therubyracer. – Jay Dorsey Dec 19 '18 at 05:03
  • Like @JeroenHeier said, don't post screenshots of images. Screenshots are not helpful (for a lot of reasons). The errors you received are in plaintext; copy and paste the errors into your question and format them as a code block so we can see them directly in your post. – anothermh Dec 19 '18 at 05:11
  • The error message says that you don't have Python 2 installed. Did you try installing Python 2? – Jörg W Mittag Dec 19 '18 at 06:02
  • I have installed Python 2.7, but the error still persists. – JHero23 Dec 19 '18 at 06:26

1 Answers1

0

Download the python 2.7 installer for Windows from https://www.python.org/downloads/release/python-2715/ and run it. After python 2.7 has been installed, retry gem install therubyracer.

Update:

Since you said you have done this and it still doesn't work, please consider reading the options at this question as well.

anothermh
  • 9,815
  • 3
  • 33
  • 52
  • I followed the link you sent me and I followed the options, and then I required the files, and I got this error when running it... C:\Users\joelg\Desktop\GitMe\RubySinatra\SinatraExcercise\SinatraCH6>ruby main.rb C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require': 126: The specified module could not be found. - C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/therubyracer-0.11.0beta1-x86-mingw32/lib/v8/init.so (LoadError) – JHero23 Dec 20 '18 at 02:24
  • Does the file `C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/therubyracer-0.11.0beta1-x86-mingw32/lib/v8/init.so` exist? – anothermh Dec 20 '18 at 02:35
  • Yes it does, I followed the directory and still nothing, and its right there – JHero23 Dec 20 '18 at 02:40
  • Try adding `C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/therubyracer-0.11.0beta1-x86-mingw32/lib/v8/` to your `PATH` and retry the operation. – anothermh Dec 20 '18 at 03:04
  • This is the point where I recommend you install [WSL](https://learn.microsoft.com/en-us/windows/wsl/install-win10) and do this on Linux because the problems you're experiencing are the exact reason people don't use Windows and Ruby together. – anothermh Dec 20 '18 at 05:22
  • Thank you for the advice, I switched to WSL, and everything works, but now I have another issue with LoadError regarding dm-postgres-adapter, already posted a question about it if you want to look, thanks again. – JHero23 Dec 22 '18 at 21:30