Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Manager project: Update google apis installation instruction #28827

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions ruby/files_and_serialization/project_event_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,18 @@

#### Installing the Google API Client

Ruby comes packaged with the `gem` command. This tool allows you to download libraries by knowing the name of the library you want to install.
In this section, we’ll use [Bundler](https://bundler.io) to manage and install our gem dependencies. Bundler ensures that the correct versions of gems are installed and works seamlessly with different Ruby versions and project requirements.

```bash
$ gem install google-api-client
Successfully installed google-api-client-0.15.0
1 gem installed
bundle init # Initializes a Gemfile if one doesn't exist
bundle add google-apis-civicinfo_v2 # Adds the gem to the Gemfile and installs it
```

If you receive a signet error when installing the Google API gem, it is due to modern Ruby updates requiring an updated version of signet that is not compatible with the API. To fix, please [downgrade your version of signet](https://github.com/googleapis/google-api-ruby-client/issues/833) before installing the gem.
Once you’ve set up your gems with Bundler, you should use the following command to run your project:

```bash
bundle exec ruby lib/event_manager.rb
```

#### Showing all legislators in a zip code

Expand Down Expand Up @@ -694,7 +697,7 @@
Running our application, we find an error.

```bash
$ ruby lib/event_manager.rb
$ bundle exec ruby lib/event_manager.rb
/ruby-2.4.0/gems/google-api-client-0.15.0/lib/google/apis/core/http_command.rb:218:in 'check_status': parseError: Failed to parse address (Google::Apis::ClientError)
```

Expand Down Expand Up @@ -784,7 +787,7 @@
If we were to replace `legislators` with `legislator_names` in our output, we would be presented with a *slightly* better output.

```bash
$ ruby lib/event_manager.rb
$ bundle exec ruby lib/event_manager.rb
EventManager initialized.
Allison 20010 ["Eleanor Norton"]
SArah 20009 ["Eleanor Norton"]
Expand Down Expand Up @@ -826,7 +829,7 @@
Running our application this time should give us a much more pleasant looking output:

```bash
$ ruby lib/event_manager.rb
$ bundle exec ruby lib/event_manager.rb
EventManager initialized.
Allison 20010 Eleanor Norton
SArah 20009 Eleanor Norton
Expand Down Expand Up @@ -1331,3 +1334,3 @@
The big boss gets excited about the results from your hourly tabulations. It looks like there are some hours that are clearly more important than others. But now, tantalized, she wants to know "What days of the week did most people register?"

- Use [Date#wday](https://docs.ruby-lang.org/en/3.3/Date.html#method-i-wday) to find out the day of the week.
Loading