简体   繁体   English

Rails设置; rails server命令无法正常工作

[英]Rails setup; rails server command not working

I am new to RoR and when I go try the rails server command I get this strange error message: 我是RoR的新手,当我去尝试rails server命令时,我得到了这个奇怪的错误信息:

/Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
    from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `rescue in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:2:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `block in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler.rb:131:in `require'
    from /Users/danielmiller/Desktop/railsTutorbook/myfirstapp/config/application.rb:7:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:74:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:74:in `block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Can anyone help with that? 任何人都可以帮忙吗?

it looks like the sqlite3 ruby gem is having some trouble. 它看起来像sqlite3 ruby​​ gem有一些麻烦。

first, make sure you have the libsqlite3 development package installed. 首先,确保安装了libsqlite3开发包。

On a debian derivitive, this would look like 在debian派生词上,这看起来像

sudo apt-get install libsqlite3-dev

then, install the gem 然后,安装宝石

gem install sqlite3

on a normal rails setup, bundler should be setup via Gemfile to install all the required gems for you. 在普通的rails设置中,应该通过Gemfile设置bundler来为你安装所有必需的gem。

bundle install

在您的应用程序中安装gem sqlite,然后重试。

Reinstall the rails . 重新安装导轨。 Are you having two different version of ruby? 你有两个不同版本的红宝石吗?

please update latest Ruby-gems using 请使用更新最新的Ruby-gems

gem update

I would recommend you to reinstall the rails using the below command, 我建议你使用下面的命令重新安装rails,

 gem install rails

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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