開発環境
cloud9
ProductName: Mac OS X
ProductVersion: 10.15.7
The Fullstack Tutorial for GraphQL
次に、次の手順に従って、アプリケーションのプロジェクトを作成します。
gem install bundler
gem install rails -v 6.0.2.1
rails new graphql-tutorial --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage --skip-action-cable --skip-javascript --skip-system-test --skip-webpack-install
cd graphql-tutorial
bundle exec rails db:create
bundle exec rails server
エラー発生
解決方法
application.rbにconfig.hostsを追記する
module GraphqlTutorial
class Application < Rails::Application
config.load_defaults 6.0
config.hosts << "hostname" #←追記
config.generators.system_tests = nil
end
end
参考記事
config.hosts Rails 6
再度サーバーを起動(bundle exec rails server)
エラー発生
解決方法
$ wget https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz
$ tar xzvf sqlite-autoconf-3290000.tar.gz
$ cd sqlite-autoconf-3290000
$ ./configure --prefix=/opt/sqlite/sqlite3
$ make
$ sudo make install
# バージョン確認
$ /opt/sqlite/sqlite3/bin/sqlite3 --version
3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
$ echo 'export LD_LIBRARY_PATH="/opt/sqlite/sqlite3/lib"' >> .bash_profile
$ source .bash_profile
参考記事
Rails6におけるsqlite3のバージョン(Your version of SQLite is too old. Active Record supports SQLite >= 3.8
Ruby on Rails 6をAmazon Linux 2で動かす
$ sqlite3 -version
SQLite header and source version mismatch
調べたところどうやら設定ファイルが混在しているようだ
http://yoshikiito-el.hatenablog.com/entry/2014/11/24/121144
現在(201022 02:21:33)
SQLite 3.8を導入できず止まっている状態
続き:参考記事
解決案:DBを変更する sqlite3→MySQL
Ruby on Rails6.0の環境構築から新規プロジェクト作成まで(メモ)
[Error Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8]
(https://stackoverflow.com/questions/56086629/error-your-version-of-sqlite-3-7-17-is-too-old-active-record-supports-sqlite)
AWS Cloud9でmysql2がインストールできなかった時の対応方法
RailsアプリのデータベースをSQLiteからMySQLに変更しようとしてもうまくいきません...
https://teratail.com/questions/208997
【Ruby on Rails】データベースを sqlite から mysql に変える
201023 01:08:24現在
Cloud9でsqlite3.8の導入は難しいようだ
そのためdbをMySQLに変更しようと思う。
試すこと
- アプリを削除する
- rails newするときに
- mysqlオプションをつけてみる
rails new graphql-tutorial -d mysql --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage --skip-action-cable --skip-javascript --skip-system-test --skip-webpack-install