简体   繁体   English

我在启动Ruby on Rails项目时遇到了问题

[英]I have issues starting a Ruby on Rails project

I'm starting a new project but I have issues installing sqlite3 on my computer. 我正在开始一个新项目,但是我在计算机上安装sqlite3时遇到了问题。 What is the problem? 问题是什么?

Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190428-9612-10i9sod.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... no
checking for dlopen()... no
missing function dlopen
*** extconf.rb failed ***
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.

I have already installed Ruby, Rails, Bundle. 我已经安装了Ruby,Rails,Bundle。 But apparently, something is missing. 但显然,缺少某些东西。

I had this error on my win7, and this was my solution: 我的win7上有这个错误,这是我的解决方案:

type ridk exec pacman -S mingw-w64-x86_64-dlfcn and install 键入ridk exec pacman -S mingw-w64-x86_64-dlfcn并安装

This should work if your install ruby in 'common' way. 如果以“常见”方式安装ruby,这应该有效。 Like 'rubyinstaller'. 喜欢'rubyinstaller'。

You can consider skipping SQLite altogether. 您可以考虑完全跳过SQLite。 The only reason Rails is setup for SQLite by default is that its easy to setup up on most systems. 默认情况下,为SQLite设置Rails的唯一原因是它易于在大多数系统上进行设置。 If not then its mostly a waste of time. 如果不是那么它主要是浪费时间。

Its not really a viable option for deployment as its file based. 它不是真正可行的部署基于文件的选项。 This is especially if you want to deploy to cloud platforms such as Heroku which use ephemeral file systems. 如果您想部署到使用临时文件系统的Heroku等云平台,尤其如此。

You will want to develop and test on the same database that you are going to deploy to such as Postgres. 您将需要在要部署到Postgres的同一数据库上进行开发和测试。

Differences between backing services mean that tiny incompatibilities crop up, causing code that worked and passed tests in development or staging to fail in production. 支持服务之间的差异意味着微小的不兼容性突然出现,导致代码工作并通过开发中的测试或暂存生产失败。 These types of errors create friction that disincentivizes continuous deployment. 这些类型的错误会产生摩擦,妨碍持续部署。 The cost of this friction and the subsequent dampening of continuous deployment is extremely high when considered in aggregate over the lifetime of an application. 当在应用的整个寿命期间总体考虑时,这种摩擦的成本以及随后的连续部署的阻尼是非常高的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM