2

I used Railsinstaller to install rails, but I still get this error message. Based on what other questions regarding this, it seems that Railsinstaller should include devkit and this problem shouldn't happen.

What did I do wrong?

By the way, this was when I changed the gemfile to include 'pg' under production (and of course, put sqlite under development and test) and then trying to run bundle install --without production.

Thanks in advance for your help!

Seungchan Lee
  • 111
  • 2
  • 3
  • 4

1 Answers1

2

If you are on Windows, then detailed instructions on installing DevKit can be found here in docs of Rubyinstaller:

https://github.com/oneclick/rubyinstaller/wiki/development-kit

After following these instructions native extensions will be able to build.

UPD: but strange, seems like Railsinstaller for Windows already includes DevKit, according to its website. Probably you only need to do step 4 from that instruction to ensure that PATH is set.

If I'm mistaken and you are on Mac, then this answer should help you.

If you were on Linux, you should probably only have installed build-essential from your package manager.

Community
  • 1
  • 1
NIA
  • 2,523
  • 22
  • 32
  • I'm on Windows, so I followed from Step 4 of the instruction. I went into railsintaller/devkit folder and ran ran ruby dk.rb init & review & install, but I got "[WARN] Skipping existing DevKit helper library for 'c:/program files /ruby-1.9.2'". One thing strange is that when I ran ruby -v before, it showed version 1.9.3. Now it says 1.9.2p290. – Seungchan Lee Feb 05 '13 at 15:04
  • Also, when I ran gem install rdiscount --platform=ruby, it siad ERROR: Error installing rdiscount: ERRORR: Failed to build gem native extension. I'm new to ruby & rails and this is really confusing! – Seungchan Lee Feb 05 '13 at 15:07
  • Well, it looks like you have some mixing of Rubies here. Have you previously installed Ruby into `C:/Program Files /ruby-1.9.2`? If so, it may conflict with the installation of Ruby included with Railsinstaller. Uninstalling both old Ruby and Railsinstaller, rebooting, and then installing Railsinstaller again on clean might help. – NIA Feb 05 '13 at 15:11
  • How would I do that cleanly? – Seungchan Lee Feb 05 '13 at 15:49
  • @SeungchanLee By "install on clean" I mean "install while no Ruby is installed in system". That is, first, uninstall both Railsinstaller and that old ruby 1.9.2 in Program Files. If after that some files from them are left in C:/Program Files and C:/Railsinstaller — delete them. Then reboot (to ensure that system enviroment variables are reset). Then install Railsinstaller again. After that, I hope, DevKit will be set up correctly. And you will be able to install gems with native extensions such as `rdiscount` or `json` in your case. – NIA Feb 05 '13 at 16:58
  • Awesome - I will definitely try that. Thanks a lot for your help! – Seungchan Lee Feb 05 '13 at 17:26