简体   繁体   中英

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:

/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.

first, make sure you have the libsqlite3 development package installed.

On a debian derivitive, this would look like

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.

bundle install

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

Reinstall the rails . Are you having two different version of ruby?

please update latest Ruby-gems using

gem update

I would recommend you to reinstall the rails using the below command,

 gem install rails

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