LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-20-2022, 05:38 PM   #1
Cameronnoah
Member
 
Registered: Mar 2022
Location: New York City
Distribution: Slackware 15
Posts: 42

Rep: Reputation: 0
Post Ruby on Rails gem not working with bundle.


I need to run a ruby project with gems and specs. When I type bundle install I received:

Code:
bash-5.1# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using bundler 2.3.9
Using diff-lcs 1.5.0
Using rspec-support 3.1.2
Fetching pg 1.3.4
Using rspec-core 3.1.7
Using rspec-expectations 3.1.2
Using rspec-mocks 3.1.3
Using rspec 3.1.0
Installing pg 1.3.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/lib64/ruby/gems/3.0.0/gems/pg-1.3.4/ext
/usr/bin/ruby -I /usr/lib64/ruby/3.0.0 -r ./siteconf20220320-7556-sm89ck.rb
extconf.rb
Calling libpq with GVL unlocked
checking for pg_config... no
checking for libpq per pkg-config... no
Using libpq from 
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*****************************************************************************

Unable to find PostgreSQL client library.

Please install libpq or postgresql client package like so:
  sudo apt install libpq-dev
  sudo yum install postgresql-devel
  sudo zypper in postgresql-devel
  sudo pacman -S postgresql-libs

or try again with:
  gem install pg -- --with-pg-config=/path/to/pg_config

or set library paths manually with:
gem install pg -- --with-pg-include=/path/to/libpq-fe.h/
--with-pg-lib=/path/to/libpq.so/

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)
	--with-pg
	--without-pg
	--enable-gvl-unlock
	--disable-gvl-unlock
	--enable-windows-cross
	--disable-windows-cross
	--with-pg-config
	--without-pg-config
	--with-pg_config
	--without-pg_config
	--with-libpq-config
	--without-libpq-config
	--with-pkg-config
	--without-pkg-config
	--with-pg-dir
	--without-pg-dir
	--with-pg-include
	--without-pg-include=${pg-dir}/include
	--with-pg-lib
	--without-pg-lib=${pg-dir}/lib64

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /usr/lib64/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/pg-1.3.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/lib64/ruby/gems/3.0.0/gems/pg-1.3.4 for
inspection.
Results logged to
/usr/lib64/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/pg-1.3.4/gem_make.out

  /usr/lib64/ruby/3.0.0/rubygems/ext/builder.rb:93:in `run'
  /usr/lib64/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
  /usr/lib64/ruby/gems/3.0.0/gems/tempfile-0.1.2/lib/tempfile.rb:317:in `open'
  /usr/lib64/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
  /usr/lib64/ruby/3.0.0/rubygems/ext/builder.rb:159:in `build_extension'
/usr/lib64/ruby/3.0.0/rubygems/ext/builder.rb:193:in `block in
build_extensions'
  /usr/lib64/ruby/3.0.0/rubygems/ext/builder.rb:190:in `each'
  /usr/lib64/ruby/3.0.0/rubygems/ext/builder.rb:190:in `build_extensions'
  /usr/lib64/ruby/3.0.0/rubygems/installer.rb:845:in `build_extensions'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/source/rubygems.rb:204:in
`install'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/installer/gem_installer.rb:54:in
`install'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/worker.rb:62:in
`apply_func'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/worker.rb:57:in
`block in process_queue'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/worker.rb:54:in
`loop'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/worker.rb:54:in
`process_queue'
/usr/lib64/ruby/gems/3.0.0/gems/bundler-2.3.9/lib/bundler/worker.rb:91:in
`block (2 levels) in create_threads'

An error occurred while installing pg (1.3.4), and Bundler cannot
continue.

In Gemfile:
  pg
Why is it not working? This is for school in particular app academy NYC, one of the top coding schools. I am trying to convince them to switch to Slackware as the main OS but I am having trouble installing and running the skeleton program that uses psql, ruby and soon enough ruby on rails.

Last edited by Cameronnoah; 03-20-2022 at 07:17 PM.
 
Old 03-20-2022, 09:15 PM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
You need to install the postgresql package. It says exactly what is missing in the error output. I suspect you would need to install this anyway to store the data in your web applications. You can find the postgresql slackbuild here:

https://slackbuilds.org/repository/1...em/postgresql/

You will need to compile support for ruby into postgresql, --with-pg --with-pg-config.

Probably something I missed. BUT, it's a ruby course for you to learn.
 
1 members found this post helpful.
Old 03-21-2022, 07:14 AM   #3
Cameronnoah
Member
 
Registered: Mar 2022
Location: New York City
Distribution: Slackware 15
Posts: 42

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mralk3 View Post
You need to install the postgresql package. It says exactly what is missing in the error output. I suspect you would need to install this anyway to store the data in your web applications. You can find the postgresql slackbuild here:

https://slackbuilds.org/repository/1...em/postgresql/

You will need to compile support for ruby into postgresql, --with-pg --with-pg-config.

Probably something I missed. BUT, it's a ruby course for you to learn.
https://petkeen.com/do-female-cows-have-horns/
 
Old 03-21-2022, 08:23 AM   #4
Cameronnoah
Member
 
Registered: Mar 2022
Location: New York City
Distribution: Slackware 15
Posts: 42

Original Poster
Rep: Reputation: 0
I installed libpqxx slackbuild, sqlite3 gem, postgresql (14.2) slackbuild and when I run rnu ./import_db.sh it says: bash-5.1# ./import_db.sh
dropdb: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
createdb: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
bash-5.1#
 
Old 03-21-2022, 09:07 AM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Did you read the README file and add the group/user to group? Have to started the postgresql service in order to connect to it?
 
Old 03-21-2022, 09:19 AM   #6
Cameronnoah
Member
 
Registered: Mar 2022
Location: New York City
Distribution: Slackware 15
Posts: 42

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mralk3 View Post
Did you read the README file and add the group/user to group? Have to started the postgresql service in order to connect to it?
I believe I did because I needed to do so before installing the psql.

Here is the output for when I try starting it:

bash-5.1# service postgressql start
bash: service: command not found
bash-5.1# postgressql start
bash: postgressql: command not found
bash-5.1# postgresql start
bash: postgresql: command not found
bash-5.1# sudo service postgressql start
sudo: service: command not found
bash-5.1# postgresql
bash: postgresql: command not found
bash-5.1# man psql
bash-5.1# sudo service postgresql-14.2 initdb
sudo: service: command not found
bash-5.1# postgresql-14.2 start
bash: postgresql-14.2: command not found
bash-5.1#

Forgive for I am new to all this and am a slow learner. I thank you for helping me and I can not show you my gratitude.
 
Old 03-21-2022, 09:27 AM   #7
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,442

Rep: Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191Reputation: 4191
Quote:
Originally Posted by Cameronnoah View Post
I believe I did because I needed to do so before installing the psql.

Here is the output for when I try starting it:

bash-5.1# service postgressql start
bash: service: command not found
bash-5.1# postgressql start
bash: postgressql: command not found
bash-5.1# postgresql start
bash: postgresql: command not found
bash-5.1# sudo service postgressql start
sudo: service: command not found
bash-5.1# postgresql
bash: postgresql: command not found
bash-5.1# man psql
bash-5.1# sudo service postgresql-14.2 initdb
sudo: service: command not found
bash-5.1# postgresql-14.2 start
bash: postgresql-14.2: command not found
bash-5.1#

Forgive for I am new to all this and am a slow learner. I thank you for helping me and I can not show you my gratitude.
https://docs.slackware.com/howtos:sl..._admin:service
 
1 members found this post helpful.
Old 03-22-2022, 10:27 AM   #8
Cameronnoah
Member
 
Registered: Mar 2022
Location: New York City
Distribution: Slackware 15
Posts: 42

Original Poster
Rep: Reputation: 0
Lightbulb

Quote:
Originally Posted by marav View Post
No offense but what is that suppose to do? Oddly enough setting up Rails in Slackware was easier than in Ubuntu. I plan on addressing issues related to Slackware in my cohort because I think a purely development based Slackware distro could be viable. Most people already program in Unix environments and if they don't they use something like WSL. Given the natural intuition of traditional UNIX environments, the fact that UNIX was made with programming in mind (in particular programming in C/C++) and the fact that most programming today in some manner involves Assembly/C/C++ I think Slackware provides a great foundation to any would be hacker or hobbyist let alone developer.

I am rambling now.
 
Old 03-22-2022, 12:20 PM   #9
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Quote:
I am rambling now.
Let me join you!

I have done contract work as a full stack developer before it was called that. Which required systems administration, application programming, UI design, scripting (js), and graphic design. Slackware comes with all the goodies to start from an excellent development stack for developers. You basically just need to install the gems and ruby version you need.

Check out "rvm", "rbenv", or similar to manage your ruby versions. Those ruby managers will allow you to use bundle and ruby as a normal user, with your environment installed into your home directory. It makes it MUCH easier to develop ruby applications quickly with many ruby gems. Ignoring the system ruby is a good idea. Upgrading ruby is possible at the system level, BUT it is best to leave your stable Linux distro alone.

Deployment is easiest with git hooks. It just makes things easier to roll back if there is a mistake. I do not typically favor Ruby on Rails. Sometimes it is just too much extra code when there are things out there like Jekyll and Sinatra. RoR definitely has its uses- especially when learning.

/end rambles

Glad to see a fellow Rubyist.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ruby / Gem] Too tired for rant. Again. Confused filemagic and ruby-filemagic Michael Uplawski Programming 2 03-12-2022 03:57 AM
LXer: Rails::API strips the fat off Ruby on Rails LXer Syndicated Linux News 0 11-23-2012 09:50 PM
[SOLVED] [Ruby on Rails] backticks don't work under rails. bartonski Programming 1 09-08-2009 04:19 PM
[SOLVED] Installing Ruby on Rails -- "gem update --system is disabled on Debian". bartonski Debian 2 08-23-2009 09:17 PM
PHP v Ruby/Ruby on Rails Neko_D Linux - General 4 02-08-2007 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration