我可以编辑我的ROR项目的gemfile吗?

时间:2021-01-19 00:21:39

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

我在oracle数据库中使用ROR我创建了一个项目,然后运行命令

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.

'无法加载此类文件 - oci8'。 ActiveRecord oracle_enhanced适配器无法加载ruby-oci8库。您可能需要安装ruby-oci8 gem。

By running the following command,

通过运行以下命令,

gem install ruby-oci8

i gets the following errors,

我得到以下错误,

Error installing ruby-oci8:

安装ruby-oci8时出错:

ERROR: Failed to build gem native extension.

错误:无法构建gem原生扩展。

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.

由于某些原因无法创建Makefile,可能缺少必要的库和/或标头。检查mkmf.log文件以获取更多详细信息。您可能需要配置选项。

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

所以我将这一行添加到我的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.

安装nio4r(2.1.0)时发生错误,Bundler无法继续。在捆绑之前确保gem install nio4r -v'2.1.0'成功。

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.

由于某些原因无法创建Makefile,可能缺少必要的库和/或标头。检查mkmf.log文件以获取更多详细信息。

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

编译器无法生成可执行文件。 (RuntimeError)您必须首先安装开发工具

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

ActiveRecord oracle_enhanced适配器无法加载ruby-oci8库

Rails 3.0.3 - Oracle_enhanced doesn't work

Rails 3.0.3 - Oracle_enhanced不起作用

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

ruby-debug由于某些原因无法创建Makefile,可能缺少必要的库和/或头文件

Nokogiri issues with Ruby on Rails

Nokogiri与Ruby on Rails有关

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

看看这个Q / A,按照这个声音就像你错过了红宝石的devtools

i have installed the rubyDevKit and run the command

我已经安装了rubyDevKit并运行命令

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'

配置无效或未列出Rubies。请修复'config.yml'并重新运行'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"?

现在,我该如何修改config.yml文件?我应该以哪种格式编写路径或我必须编写哪条路径?是“C:\ Sites”吗?

2 个解决方案

#1


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.

我们都去过那儿。通常ruby是一种非常友好的语言,但与软件开发中的所有工具一样,存在依赖性......而这些可能是令人讨厌的。

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.

要回答你的标题问题,你绝对可以编辑你的gemfile,添加你需要的所有宝石,以及指定版本或来源等。

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.

然后,你应该能够捆绑安装,它将安装gemfile中的所有gem,并在生成的Gemfile.lock中设置它们的版本。

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

编译器无法生成可执行文件。 (RuntimeError)您必须首先安装开发工具

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

这似乎是你的gcc的一个问题。这个问题似乎是一个合适的候选者:编译器无法生成可执行文件。 (RuntimeError)

#2


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.

确保您具有与java关联的运行时。因为您正在使用oracle数据库。确保你拥有这些宝石(therubyracer,execjs,rubyrhino(或therubyrhino)),同时确保你的系统中安装了nod.js.安装这些宝石后,你不应该有任何运行时错误。

#1


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.

我们都去过那儿。通常ruby是一种非常友好的语言,但与软件开发中的所有工具一样,存在依赖性......而这些可能是令人讨厌的。

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.

要回答你的标题问题,你绝对可以编辑你的gemfile,添加你需要的所有宝石,以及指定版本或来源等。

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.

然后,你应该能够捆绑安装,它将安装gemfile中的所有gem,并在生成的Gemfile.lock中设置它们的版本。

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

编译器无法生成可执行文件。 (RuntimeError)您必须首先安装开发工具

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

这似乎是你的gcc的一个问题。这个问题似乎是一个合适的候选者:编译器无法生成可执行文件。 (RuntimeError)

#2


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.

确保您具有与java关联的运行时。因为您正在使用oracle数据库。确保你拥有这些宝石(therubyracer,execjs,rubyrhino(或therubyrhino)),同时确保你的系统中安装了nod.js.安装这些宝石后,你不应该有任何运行时错误。