0

I just cloned a repo, and can't even get to run a local server on my machine. Other co-workers said they had no problem, so I assume there's something wrong with my enviroment.

$ bundle exec rails server
=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
/home/fran/.rbenv/versions/2.6.5/bin/ruby: symbol lookup error: /home/fran/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/puma-4.3.1/lib/puma/puma_http11.so: undefined symbol: OPENSSL_init_ssl

I already tried installing ruby 2.6.5 with my openssl dir like this:

$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/lib/ssl" rbenv install  2.6.5

But the problem persists.

Any hint on this error? Never happened to me before.

  • Does `gem uninstall puma; gem install puma -v '4.3.1' -- --with-cppflags=-I/usr/lib/ssl; bundle install; bundle exec rails s` work? – anothermh Jul 23 '20 at 19:18
  • Yes! This worked! What are those `cppflags`? – Franco Mariani Jul 23 '20 at 19:36
  • Puma's your web server, it needs to know where your OpenSSL libs are when it compiles. That's all the flags do. – anothermh Jul 23 '20 at 19:41
  • There is an existing question with the answer I provided, since it worked I recommend deleting your question: [puma gem - Failed to build gem native extension](https://stackoverflow.com/questions/30143180/puma-gem-failed-to-build-gem-native-extension) – anothermh Jul 23 '20 at 19:42
  • @anothermh But the error message is different there as far as I can tell. Someone having the same issue as op wouldn't be able to find it if he searched for an answer and he would have to open another question. Wouldn't it make more sense for you to post the command as an answer or mark this question as duplicate referring to the question you linked? – Viktor Jul 23 '20 at 19:55
  • If you find yourself adding flags to install a gem, then once you have them right, you can (should?) add those into your `~/.bundle/config` file. – tilthouse Jul 23 '20 at 21:26
  • Fair points @Viktor! – anothermh Jul 24 '20 at 01:25

0 Answers0