首页 > 系统 > Linux > 正文

解决rails server 错误问题

2024-08-27 23:59:21
字体:
来源:转载
供稿:网友

在我安装好 Ruby on Rails 后,使用 rails new 命令新建一个项目,然后切换到项目下执行 rails server,出现如下错误:

  1. sam@linux-qo4p:~/front/ror|master⚡⇒  rails server 
  2. Ignoring RedCloth-4.2.9 because its extensions are not built.  Try: gem pristine RedCloth-4.2.9 
  3. Ignoring posix-spawn-0.3.9 because its extensions are not built.  Try: gem pristine posix-spawn-0.3.9 
  4. Ignoring rdiscount-2.1.7.1 because its extensions are not built.  Try: gem pristine rdiscount-2.1.7.1 
  5. /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError) 
  6.         from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'  --Vevb.com 
  7.         from /home/sam/front/ror/config/boot.rb:4:in `<top (required)>' 
  8.         from bin/rails:3:in `require_relative' 
  9.         from bin/rails:3:in `<main>' 

这似乎是我把 openSUSE 系统从 13.1 升级到 13.2 后才出现的错误,我的情况里,尝试错误信息中的提示方法 gem pristine RedCloth 并不能消除以上错误.

最后的解决办法是:gem pristine --all,切换到项目根目录,bundle install,再次跑 rails server,可以正常启动不报错,此后,rails new 新建的项目也不再报错.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表