rails 的新手坚持使用 rails 服务器命令

New to rails stuck with rails server command

我是 rails 上 ruby 的新手,当我输入 rails 服务器命令时,我收到一条奇怪的消息,我不知道如何处理。

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.

我想我已经安装了所有的 gem

*** 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)

我的 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]

如果有更多经验的人能为我指出正确的方向,我将不胜感激。我已经为这个安装工作​​好几天了!

谢谢

您似乎安装了 nokogiri,但 ruby 版本错误。它是为 ruby 2.2.0 安装的,但您使用的是 ruby 2.2.3.

添加这两个文件:

.ruby-gemset

rails4.2.4

.ruby-版本

ruby-2.2.3

然后运行:

bundle install