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

Cannot install Wagon on M1 Mac #419

Open
josephmasongsong opened this issue Jul 13, 2023 · 5 comments
Open

Cannot install Wagon on M1 Mac #419

josephmasongsong opened this issue Jul 13, 2023 · 5 comments

Comments

@josephmasongsong
Copy link

I am on an M1 Mac Pro and I'm trying to pick up a legacy client project that uses Locomotive CMS. Upon running the command gem install locomotivecms_wagon --pre the gem installation errors out with:

Building native extensions. This could take a while...
ERROR:  Error installing locomotivecms_wagon:
	ERROR: Failed to build gem native extension.

    current directory: /Users/josephmasongsong/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/thin-1.6.4/ext/thin_parser
/Users/josephmasongsong/.rbenv/versions/3.0.6/bin/ruby -I /Users/josephmasongsong/.rbenv/versions/3.0.6/lib/ruby/3.0.0 -r ./siteconf20230712-87300-4ezkub.rb extconf.rb
checking for main() in -lc... yes
creating Makefile

current directory: /Users/josephmasongsong/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/thin-1.6.4/ext/thin_parser
make DESTDIR\= clean

current directory: /Users/josephmasongsong/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/thin-1.6.4/ext/thin_parser
make DESTDIR\=
compiling parser.c
parser.c:31:18: warning: unused variable 'http_parser_en_main' [-Wunused-const-variable]
static const int http_parser_en_main = 1;
                 ^
1 warning generated.
compiling thin.c
thin.c:242:3: error: call to undeclared function 'thin_http_parser_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  thin_http_parser_init(hp);
  ^
thin.c:242:3: note: did you mean 'http_parser_init'?
./parser.h:41:5: note: 'http_parser_init' declared here
int http_parser_init(http_parser *parser);
    ^
thin.c:260:3: error: call to undeclared function 'thin_http_parser_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:277:3: error: call to undeclared function 'thin_http_parser_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:294:3: error: call to undeclared function 'thin_http_parser_finish'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  thin_http_parser_finish(http);
  ^
thin.c:294:3: note: did you mean 'Thin_HttpParser_finish'?
thin.c:290:7: note: 'Thin_HttpParser_finish' declared here
VALUE Thin_HttpParser_finish(VALUE self)
      ^
thin.c:296:10: error: call to undeclared function 'thin_http_parser_is_finished'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
thin.c:334:5: error: call to undeclared function 'thin_http_parser_execute'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    thin_http_parser_execute(http, dptr, dlen, from);
    ^
thin.c:334:5: note: did you mean 'Thin_HttpParser_execute'?
thin.c:317:7: note: 'Thin_HttpParser_execute' declared here
VALUE Thin_HttpParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE start)
      ^
thin.c:338:8: error: call to undeclared function 'thin_http_parser_has_error'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if(thin_http_parser_has_error(http)) {
       ^
thin.c:338:8: note: did you mean 'http_parser_has_error'?
./parser.h:44:5: note: 'http_parser_has_error' declared here
int http_parser_has_error(http_parser *parser);
    ^
thin.c:359:10: error: call to undeclared function 'thin_http_parser_has_error'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return thin_http_parser_has_error(http) ? Qtrue : Qfalse;
         ^
thin.c:374:10: error: call to undeclared function 'thin_http_parser_is_finished'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
9 errors generated.
make: *** [thin.o] Error 1

make failed, exit code 2

@did do you have any suggestions? Thank you.

@manuchap
Copy link
Contributor

manuchap commented Jul 13, 2023

I had the same issue:
gem install thin -v '1.6.4' -- --with-cflags="-Wno-error=implicit-function-declaration

@josephmasongsong
Copy link
Author

I had the same issue: gem install thin -v '1.6.4' -- --with-cflags="-Wno-error=implicit-function-declaration

Thank you @manuchap this did the trick for me. However, wagon clone is not working for me:

Deprecation warning: Expected string default value for '--live-reload-port'; got false (boolean).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
ERROR: "wagon clone" was called with arguments ["<site_name>", "https://station.locomotive.works", "-h", "<site_handle>"]
Usage: "wagon clone NAME HOST [PATH]"
Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Locomotive::Wagon::CLI::Main`
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.

Where <site_name> and <site_handle> aren't the real values obviously, but I am copying the command straight from the backend of the Locomotive hosted site?

@jfi
Copy link

jfi commented Feb 2, 2024

I ended up installing Ruby 2.7.8 to end up with wagon at 3.1.1.

With Ruby 3.0.0, the install fails completely.

@greyskin
Copy link

greyskin commented Feb 3, 2024

Yeah, I've never managed to get it to work with any version of Ruby beyond 2.7.x.

@manuchap
Copy link
Contributor

manuchap commented Apr 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants