Ruby Ruby on Rails 5 Basics Creating an App Creating a Rails App

Brian Patterson
Brian Patterson
19,585 Points

Can't run rails server.

Can't seem to run rails server. I get the following error when I run bin/rails server '/Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/nokogiri-1.6.8.1/lib/nokogiri.rb:32:in require': incompatible library version - /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.bundle (fatal) from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/nokogiri-1.6.8.1/lib/nokogiri.rb:32:inrescue in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/nokogiri-1.6.8.1/lib/nokogiri.rb:28:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/loofah-2.0.3/lib/loofah.rb:3:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/loofah-2.0.3/lib/loofah.rb:3:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/sanitize_helper.rb:2:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/sanitize_helper.rb:2:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/text_helper.rb:32:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/text_helper.rb:32:in <module:TextHelper>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/text_helper.rb:29:in<module:Helpers>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/text_helper.rb:6:in <module:ActionView>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/text_helper.rb:4:in<top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_tag_helper.rb:18:in require' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_tag_helper.rb:18:in<module:FormTagHelper>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_tag_helper.rb:14:in <module:Helpers>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_tag_helper.rb:8:in<module:ActionView>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_tag_helper.rb:6:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_helper.rb:4:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers/form_helper.rb:4:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers.rb:50:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers.rb:50:in <module:Helpers>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers.rb:4:in<module:ActionView>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/actionview-5.0.0.1/lib/action_view/helpers.rb:3:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:7:inrequire' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:7:in <module:Context>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:6:in<module:Rails>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:5:in <module:Sprockets>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/rails/context.rb:4:in<top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:7:in require' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:7:in<top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/all.rb:14:in require' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/all.rb:14:inblock in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/all.rb:12:in each' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/all.rb:12:in<top (required)>' from /Users/briankaty1/Documents/Projects/treehouse/blog/blog/config/application.rb:3:in require' from /Users/briankaty1/Documents/Projects/treehouse/blog/blog/config/application.rb:3:in<top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:in require' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:88:inblock in server' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in tap' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:inserver' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in run_command!' from /Users/briankaty1/.rvm/gems/ruby-2.3.1@global/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in<top (required)>' from /Users/briankaty1/Documents/Projects/treehouse/blog/blog/bin/rails:9:in require' from /Users/briankaty1/Documents/Projects/treehouse/blog/blog/bin/rails:9:in<top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in load' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/rails.rb:28:incall' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/command.rb:7:in call' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client.rb:30:inrun' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/bin/spring:49:in <top (required)>' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/binstub.rb:31:inload' from /Users/briankaty1/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/binstub.rb:31:in <top (required)>' from /Users/briankaty1/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:inrequire' from /Users/briankaty1/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in require' from /Users/briankaty1/Documents/Projects/treehouse/blog/blog/bin/spring:14:in<top (required)>' from bin/rails:3:in load' from bin/rails:3:in<main>' '

Andrew Wiley
Andrew Wiley
5,375 Points

type rails --version to see what version of rails you have active. Once you see what version you have active. Type gem list to see if you have more then one rails installed on your computer. If you do then you can uninstall the oldest rails you have by typing gem uninstall rails "VERSION OF YOUR CHOOSE"

You also may need to install or update the gem byebug.

Jorge Pimentel
Jorge Pimentel
Pro Student 5,417 Points

Depending on your Ruby version you might be able to just run Bundle install to solve this. Also I would make sure to check if your database is running in the back.

Alex Hinson
Alex Hinson
20,184 Points

Can you post your Gemfile?

1 Answer

Brian Patterson
Brian Patterson
19,585 Points

I think I know why. I did not setup the environment. It now works.