rails安装
How I solved Nokogiri error and installed Ruby on Rails on Fedora OS
我如何解决Nokogiri错误并在Fedora OS上安装Ruby on Rails
Note: This post does not discuss about what these problems were, rather it provides solution to the problems which I faced.
注意: 本文不讨论这些问题是什么,而是提供了我所遇到问题的解决方案。
I was following a tutorial, Pragmatic Studio Rails Course. In that exercise, it asks you to make a rails app.
我一直在关注Pragmatic Studio Rails课程教程。 在该练习中,它要求您制作一个Rails应用程序。
Going through the tutorial, I did rails new eventz
but it could not install all the packages present in the Gemfile. It always showed this error:
在本教程中,我做了rails new eventz
但是它无法安装Gemfile中存在的所有软件包。 它总是显示此错误:
The initial packages couldn’t be installed so I tried bundle install --path vendor/bundle
but that too resulted in the error.
最初的软件包无法安装,所以我尝试了bundle install --path vendor/bundle
但这也导致了错误。
No matter what solution I use it always ended up in this error:
无论我使用哪种解决方案,总是会导致以下错误:

解决方案 (The Solution)
After a lot of frustration and attempts, I got the something on FedoraProject.
经过很多挫折和尝试,我在FedoraProject上得到了一些东西。
The problem was: I did not have the proper files required to bundle things together.
问题是:我没有足够的文件来捆绑东西。
解决此错误的命令: (Commands that fixed this error:)
$ sudo dnf group install "C Development Tools and Libraries"
$ sudo dnf install ruby-devel zlib-devel
$ gem install rails
$ bundle install
If you get sqlite3
error that means you’re on the right track
如果您收到sqlite3
错误,则表示您sqlite3
正确的轨道上
You have to install sqlite3
header packages, you can get the package here.
您必须安装sqlite3
标头软件包,您可以在此处获取该软件包。
This command installs the files.
此命令将安装文件。
dnf install sqlite-devel
then generate bundle
然后生成捆绑
bundle install
And, voila! You are good to go. Run your server using:
而且,瞧! 你已准备好出发。 使用以下命令运行服务器:
rails s

Now, your app starts at http://localhost:3000
现在,您的应用程序从http://localhost:3000

I wasted my 20+ hours on this problem. I hope no one else has to do that.
我在这个问题上浪费了20多个小时。 我希望没有其他人必须这样做。
If you found something wrong with the article or something doesn't work or maybe you found another solution, please mention them in the responses so that don't have to go through things that you have.
如果您发现文章有问题或不起作用,或者您找到了另一种解决方案,请在回复中提及它们,这样就不必遍历您已有的东西。
Thank you for your time.
感谢您的时间。
I’m Anas Ansari.
我是Anas Ansari。
翻译自: https://medium.com/@anasansari157/nokogiri-error-on-installing-rails-c0b2cdf95e1b
rails安装