运行rails服务器时出错

时间:2018-01-29 08:00:18

标签: ruby-on-rails json ruby rubygems

/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in 

`require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.6 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.6/ext/json/ext/generator/gem_make.out

An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.

在Gemfile中:

 coffee-rails was resolved to 3.2.2, which depends on 
        railties was resolved to 3.2.16, which depends on
          rdoc was resolved to 3.12.2, which depends on
            json

在运行rails时遇到此错误s。如何解决它

1 个答案:

答案 0 :(得分:0)

评论gemfile的内容并将ruby和rails更新到最新的稳定版本将解决大多数错误。 对我来说,我使用以下步骤重新安装了ruby和rails:

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04