Rails无法安装

时间:2019-03-10 23:26:43

标签: ruby-on-rails ruby sqlite rubygems

首先,我对Rails感到很陌生,我相信这个问题会显示出来。我将按照gorails.com上的步骤设置本地服务器。当我可以访问互联网时,我也会使用codeanywhere。当我尝试安装(安装新的myapp的)导轨时,我不断从终端命令中得到以下错误

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."

对此事的任何帮助将不胜感激。预先感谢。

2 个答案:

答案 0 :(得分:0)

请在名为Gemfile的ruby rails项目中编辑文件,然后更改以下内容

gem  'sqlite3'

gem 'sqlite3', '~> 1.3.11'

现在运行以下命令来安装Gem

bundle install

现在运行您的Rails项目

rails s

答案 1 :(得分:0)

我认为您缺少sqlite3。 运行命令

sudo apt-get install -y sqlite3 libsqlite3-dev

然后将gemfile修改为

gem 'sqlite3', '~> 1.3.11'

然后运行

bundle install

在rails中,需要在本地安装一些软件包,之后可以将它们包含在gemfile中。 mysqlpsql也是如此。