新的rails卡住了rails服务器命令

时间:2015-10-13 05:49:19

标签: ruby-on-rails gem

我是ruby on 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.

我想我已经安装了所有宝石

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

如果有经验丰富的人可以指出我正确的方向,我会非常感激。我已经在这个安装工作​​了好几天了!

由于

1 个答案:

答案 0 :(得分:0)

看起来你已经安装了nokogiri但是错误版本的ruby。它是为ruby 2.2.0安装的,但你使用的是ruby 2.2.3。

添加这两个文件:

.ruby-宝石

override func viewDidLoad() {
        super.viewDidLoad()

        UIApplication.sharedApplication().idleTimerDisabled = true
        self.navigationController?.navigationBarHidden = true
        let scene = SceneClass(fileNamed: "xxxxxxxx.sks");
        self.view = SKView();

        let skView = self.view as! SKView

        /* Sprite Kit applies additional optimizations to improve rendering performance */
        skView.ignoresSiblingOrder = true
        scene!.cockViewController = self;

        /* Set the scale mode to scale to fit the window */
        scene!.scaleMode = .Fill

        scene!.view?.autoresizesSubviews = true;
        scene?.delegates = self
        skView.presentScene(scene)

    }

.ruby版本

rails4.2.4

然后运行:

ruby-2.2.3