简体   繁体   中英

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.

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:

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. It's installed for ruby 2.2.0 but you're using ruby 2.2.3.

add these two files:

.ruby-gemset

rails4.2.4

.ruby-version

ruby-2.2.3

Then run:

bundle install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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