0

I am using ROR with oracle database I created a project and then run the command

rails generate migration test

I get the error

'cannot load such file -- oci8'. ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. You may need install ruby-oci8 gem.

By running the following command,

gem install ruby-oci8

i gets the following errors,

Error installing ruby-oci8:

ERROR: Failed to build gem native extension.

Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Error Message:

The compiler failed to generate an executable file.

You have to install development tools first.

So I added this line to my gemfile

gem 'ruby-oci8', '~> 2.0.6'

after that i run

bundle install

i get this error

An error occurred while installing nio4r (2.1.0), and Bundler cannot continue. Make sure that gem install nio4r -v '2.1.0' succeeds before bundling.

then i run this command

gem install nio4r -v '2.1.0'

i get this error

Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details.

The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first

What should I do? I am stucked in loop of these errors.

I followed these links but in vain.

ActiveRecord oracle_enhanced adapter can't load ruby-oci8 library

Rails 3.0.3 - Oracle_enhanced doesn't work

ruby-debug Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers

Nokogiri issues with Ruby on Rails

Take a look at this Q/A, by following this Sounds like you're missing the devtools for ruby

i have installed the rubyDevKit and run the command

ruby dk.rb init

but on running this command

ruby dk.rb install

i got this error

Invalid configuration or no Rubies listed. Please fix 'config.yml' and rerun 'ruby dk.rb install'

now, how should i modify config.yml file? In which format should i write the path or which path I have to write ? is it "C:\Sites"?

Farrukh Sarmad
  • 315
  • 2
  • 5
  • 24
  • 1
    It can be extremely fustrating, I know. Been there. Unfortunately, you don't really have any other option, but to persevere. Read error message, google how to fix/prevent it, repeat until success. In particular, most of the error messages you posted suggest that you install development tools. Have you tried that? – Sergio Tulentsev Nov 03 '17 at 08:49
  • This problems seems similar to this. Check this link : https://github.com/CocoaPods/CocoaPods/issues/1727 – Sony Mathew Nov 03 '17 at 10:06
  • yes i have installed the development kit ..... as it is working with all other projects and databases. I just faced these issue while working with oracle databases @SergioTulentsev – Farrukh Sarmad Nov 06 '17 at 06:22

2 Answers2

1

Well, not much to say but this sucks!

We've all been there. Usually ruby is a very friendly language, but as with all tools in software development, there are dependencies... and these can be nasty.

To answer your title question, you can definitely edit your gemfile add all the gems you need to it, as well as specify versions or sources etc.

Then, you should be able to just bundle install which will install all the gems in your gemfile, and set their versions in a generated Gemfile.lock.

The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first

This seems like a problem with your gcc. This issue seems like a fitting candidate: The compiler failed to generate an executable file. (RuntimeError)

Stuart
  • 1,054
  • 9
  • 20
0

Make sure you have the runtimes associated with java. Since you are working with oracle database. Make sure you have these gems (therubyracer,execjs,rubyrhino(or therubyrhino), also make sure you have nod.js installed in your system. After installing these gems you shouldn't have any runtime error.

george
  • 19
  • 2