简体   繁体   English

Rails的新手被Rails Server命令卡住了

[英]New to rails stuck with rails server command

i am new to ruby on rails, when i enter rails server command i get a strange message which i don't know how to deal with. 我是Rails上的红宝石新手,当我输入Rails Server命令时,我收到一条奇怪的消息,我不知道该如何处理。

Using tzinfo-data 1.2015.7
Using uglifier 2.7.2
Using web-console 2.2.1
Bundle complete! 12 Gemfile dependencies, 53 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

C:\Users\dell notebook>cd Mybook

C:\Users\dell notebook\MyBook>rails server
E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nok
ogiri.rb:29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)

        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mi
ngw32/lib/nokogiri.rb:29:in `rescue in <top (required)>'
        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mi
ngw32/lib/nokogiri.rb:25:in `<top (required)>'
        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah
.rb:3:in `require'
        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah
.rb:3:in `<top (required)>'
        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.
0.2/lib/rails-html-sanitizer.rb:2:in `require'
        from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.

i think i have all the gems installed 我想我已经安装了所有宝石

*** LOCAL GEMS ***

actionmailer (4.2.4)
actionpack (4.2.4)
actionview (4.2.4)
activejob (4.2.4)
activemodel (4.2.4)
activerecord (4.2.4)
activesupport (4.2.4)
arel (6.0.3)
bigdecimal (1.2.6)
binding_of_caller (0.7.2)
builder (3.2.2)
bundler (1.10.6)
byebug (6.0.2)
coffee-rails (4.1.0)
coffee-script (2.4.1)
coffee-script-source (1.9.1.1)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.6.0)
globalid (0.3.6)
i18n (0.7.0)
io-console (0.4.3)
jbuilder (2.3.2)
jquery-rails (4.0.5)
json (1.8.3, 1.8.1)
loofah (2.0.3)
mail (2.6.3)
mime-types (2.6.2)
mini_portile (0.6.2)
minitest (5.8.1, 5.4.3)
multi_json (1.11.2)
nokogiri (1.6.6.2 x86-mingw32)
power_assert (0.2.2)
psych (2.0.8)
rack (1.6.4)
rack-test (0.6.3)
rails (4.2.4)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
railties (4.2.4)
rake (10.4.2)
rdoc (4.2.0)
sass (3.4.19)
sass-rails (5.0.4)
sdoc (0.4.1)
sprockets (3.4.0)
sprockets-rails (2.3.3)
sqlite3 (1.3.11 x86-mingw32)
test-unit (3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
tzinfo-data (1.2015.7)
uglifier (2.7.2)
web-console (2.2.1)

My rails and ruby versions are: 我的rails和ruby版本是:

C:\Users\dell notebook\MyBook>rails -v
Rails 4.2.4

C:\Users\dell notebook\MyBook>ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]

If someone with more experience could just point me in the right direction, I would greatly appreciate it. 如果有更多经验的人可以为我指明正确的方向,我将不胜感激。 I have been working on this install for days! 我已经为这个安装工作​​了几天了!

Thanks 谢谢

It looks like you have nokogiri installed but for the wrong version of ruby. 看来您已安装了nokogiri,但使用的是错误版本的ruby。 It's installed for ruby 2.2.0 but you're using ruby 2.2.3. 它是为ruby 2.2.0安装的,但是您使用的是ruby 2.2.3。

add these two files: 添加这两个文件:

.ruby-gemset .ruby,宝石

rails4.2.4

.ruby-version .ruby版本

ruby-2.2.3

Then run: 然后运行:

bundle install

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

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