質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

4回答

1457閲覧

sqlite3のエラーでサーバーが建てられません

ryosui0521

総合スコア7

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/01/28 13:48

前提・実現したいこと

https://gabekore.org/mac-ruby-rails-overview
こちらの方のブログを元にrailsのインストール
サーバーの構築に挑戦中でした。

発生している問題・エラーメッセージ

:MyApp honmaryousui$ rails s
Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.

こちらに対しbundle installを実行

〜略〜
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
〜略〜
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
〜略〜
An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.3.13' succeeds before bundling.

とエラーが出てしまいました。

試したこと

:gem install sqlite3 -v '1.3.13'
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.13
Parsing documentation for sqlite3-1.3.13
Done installing documentation for sqlite3 after 0 seconds
1 gem installed
こちらはインストールされるみたいなのですが、bundle installを行なっても
同じエラーが起きます。

また、別サイトで見つけたbundle updateを試して見ましたが、
結局同じエラーが起きてしました。

補足情報

プログラミングを勉強し始めてまだ5時間ぐらいでつまずいています。
OS X high sierra

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答4

0

ベストアンサー

既存のsqlite3と混在しちゃっているんですかね。

プロジェクト(rails new で作られたディレクトリ配下)で以下の手順でやったらどうでしょう。

bundle install --path vendor/bundle bundle exec rails s

1行目は関係あるライブラリをvendor/bundle配下にインストール
2行目はそのプロジェクトのbundlerでインストールしたものを利用する

という意味合いです(すいません。なんかうまい表現ができない)

投稿2018/01/30 14:15

yatta47

総合スコア208

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ryosui0521

2018/02/01 12:41

出来ました!!!と思ったのですが、 サーバーにアクセスが出来ませんでした。。。 以下rails s後のログです /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now => Booting WEBrick => Rails 4.0.2 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated Exiting Traceback (most recent call last): 5482: from bin/rails:4:in `<main>' 5481: from bin/rails:4:in `require' 5480: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>' 5479: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap' 5478: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>' 5477: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start' 5476: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app' 5475: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app' ... 5470 levels... 4: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' 3: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' 2: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' 1: from /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>' /Users/honmaryousui/RailsTest/proj_a/MyApp/vendor/bundle/ruby/2.5.0/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>': stack level too deep (SystemStackError)
yatta47

2018/02/02 00:18

サーバアクセスというのは、 http://localhost:3000 ってアクセスしたら何も表示されなかったということですかね。
ryosui0521

2018/02/03 07:23

そうです、クロームでもサファリでも確認できませんでした。。
yatta47

2018/02/03 12:27

起動は bundle exec rails s でやっているんですよね。 正常起動したら => Booting WEBrick => Rails 4.0.2 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server で止まるはずなんですが・・・・
ryosui0521

2018/02/04 13:55 編集

=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000 アクセスができない => Run `rails server -h` for more startup options Could not find rake-12.3.0 in any of the sources Run `bundle install` to install missing gems. 再びbundleをインストールしろと言われ 頭にbundle をつけると ERROR: "bundle help" was called with arguments ["rails", "server"] Usage: "bundle help [COMMAND]"と出てきました。(命令出来ていない?) => Ctrl-C to shutdown server 押すとおそらく成功しているのか、改行される。 bundle exec rails sを再び入力すると起動出来ている様子 このような感じで、起動はしているが機能はしていない?状態です。 ログが解読できないので、もしかしたらそもそも起動すらできていない気もします。
guest

0

ディレクトリが間違えていたみたいで、gemfileと同じところでbundle installをしたらうまくいきました。
しかしrails sをしても変化なし。
Could not find sqlite3-1.3.13 in any of the sources
Run bundle install to install missing gems.
と出てしまいます。

投稿2018/01/30 13:38

ryosui0521

総合スコア7

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

既存のsqliteとhomebrew混同してしまっているかも知れない?
パスを通す?方法を試しましたが、うまく出来ていないのかインストールがやはり出来ませんでした。

投稿2018/01/30 12:22

ryosui0521

総合スコア7

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Try 'brew install sqlite3','yum install sqlite-devel' or 'apt-get install libsqlite3-dev'とのことなので、やってみたらいかがでしょうか。
Macならbrewでしょう。

投稿2018/01/29 08:47

altb

総合スコア104

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ryosui0521

2018/01/29 11:03

ご返答ありがとうございます!! Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae binutils ccache dpkg lame netcdf rgbds vault bit cfr-decompiler encfs libebur128 osquery rsync btfs checkstyle freeradius-server magic-wormhole ranger tintin Warning: sqlite 3.22.0 is already installed 早速やって見たところ、すでにインストール済みと判断されました。 bundle installを実行しましたが、再び同じエラーが繰り返されてしまいました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問