我在Rails中安装丢失的宝石时遇到了麻烦

时间:2022-02-25 22:26:02

I'm having problems starting my Rails web server. I try to enter "rails server" in the cmd prompt but I get the following error:

我在启动Rails Web服务器时遇到问题。我尝试在cmd提示符中输入“rails server”但是我收到以下错误:

C:\Ruby193\demo>rails server
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m

but whenever I then do a bundle install to install the missing gem, I get this error:

但每当我进行捆绑安装以安装缺少的gem时,我会收到此错误:

C:\Ruby193\demo>bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.2.0)
Using activesupport (3.2.3)
Using builder (3.0.0)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.3)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.2)
Using actionpack (3.2.3)
Using mime-types (1.18)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Using bundler (1.1.3)
Using coffee-script-source (1.3.1)
Using execjs (1.3.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.6.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extensio
.

    C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile

make
'make' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6
6 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.6/ext/json/ext/g
nerator/gem_make.out
An error occured while installing json (1.6.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.6'` succeeds before bundling.

I then tried to install json without any luck. Any suggestions?

然后我试着安装json而没有任何运气。有什么建议?

1 个解决方案

#1


3  

Since you're on Windows, you need to install the Development Kit to be able to build gems with native extensions.

由于您使用的是Windows,因此需要安装开发工具包才能构建具有本机扩展的gem。

https://github.com/oneclick/rubyinstaller/wiki/development-kit

#1


3  

Since you're on Windows, you need to install the Development Kit to be able to build gems with native extensions.

由于您使用的是Windows,因此需要安装开发工具包才能构建具有本机扩展的gem。

https://github.com/oneclick/rubyinstaller/wiki/development-kit