简体   繁体   English

Rails 不会安装

[英]Rails won't install

To start I'm pretty new at rails which I'm sure this question will show.首先,我对 rails 还很陌生,我相信这个问题会显示出来。 I was about to follow the steps on gorails.com to setup a local server.我正要按照 gorails.com 上的步骤设置本地服务器。 I also use codeanywhere for when I have internet access.当我可以访问互联网时,我也使用 codeanywhere。 When I try to install (rails new myapp) rails I keep getting the following error from my terminal command当我尝试安装 (rails new myapp) rails 时,我的终端命令不断收到以下错误

extconf failed, exit code 1

Gem files will remain installed in
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/gems/sqlite3-1.4.0
for inspection.
Results logged to
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/extensions/universal-darwin-17/2.3.0/sqlite3-1.4.0/gem_make.out

An error occurred while installing sqlite3 (1.4.0), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  sqlite3
         run  bundle exec spring binstub --all
Could not find gem 'uglifier (>= 1.3.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems."

Any Help on the matter would be greatly appreciated.对此事的任何帮助将不胜感激。 Thanks in advance.提前致谢。

Please edit the file in your ruby rails project named Gemfile and change following请编辑名为Gemfile ruby rails 项目中的文件并更改以下内容

gem  'sqlite3'

to

gem 'sqlite3', '~> 1.3.11'

Now run following command to install Gem现在运行以下命令来安装 Gem

bundle install

now run your rails project现在运行你的 Rails 项目

rails s

I think you are missing sqlite3.我认为您缺少 sqlite3。 Run the command运行命令

sudo apt-get install -y sqlite3 libsqlite3-dev

Then modify gemfile to然后修改gemfile为

gem 'sqlite3', '~> 1.3.11'

Then run然后运行

bundle install

In rails some packages needs to be installed in your local ,after which they can be included in your gemfile.在 rails 中,一些软件包需要安装在您的本地,然后它们可以包含在您的 gemfile 中。 The same applies for mysql and psql .这同样适用于mysqlpsql

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

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