Downloading ruby-2.7.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2 Installing ruby-2.7.1... ruby-build: using readline from homebrew Installed ruby-2.7.1 to /Users/username/.anyenv/envs/rbenv/versions/2.7.1
$ bundler init Writing new Gemfile to ~/github/github_actions_for_rails/Gemfile
Gemfileの更新
作成したGemfileを更新します。MySQLを利用する予定なのでmysql2を追加します。
1 2
gem 'rails' gem 'mysql2'
bundle install
bundle installします
1 2 3 4 5 6 7 8 9 10 11
Installing mysql2 0.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
(中略)
linking shared-object mysql2/mysql2.bundle ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [mysql2.bundle] Error 1
$ ./bin/rails s -b 0.0.0.0 => Booting Puma => Rails 6.0.3.2 application starting in development => Run `rails server --help` for more startup options Puma starting in single mode... * Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop