Error while running rake db:create

When i run the command in jagtarsingh@MacBook-Air-3 ~/diaspora (master)
RIALS_ENV=development bundle exec rake db:create
it says
rbenv: version `2.4’ is not installed (set by /Users/jagtarsingh/diaspora/.ruby-version

Screenshot is attached
17%20AM

Any help would be appreciated.

There’s a typo in your command: It should be

RAILS_ENV=development bundle exec rake db:create

(‘RAILS’ not ‘RIALS’).

If that doesn’t work you might need to check the PATH= settings in your .bash_profile or .bashrc file. Someone else would probably need to help you with that as I get a bit confused there! But try correcting the typo first and see if that works.

Still the error is same.
51%20PM

OK. Probably a silly question, but have you actually installed Ruby 2.4?

Try

rvm list

You will see a list of installed Ruby versions. => to the left of a version indicates the current version; * indicates the default version; =* indicates the current && default version.

If Ruby 2.4 does not appear in the list, install it with

rvm install ruby 2.4

I imagine that would solve the problem. If, however, it is in the list of installed versions but not set as current and default version, enter

rvm --default use 2.4

I’m not sure the last command will be of use, but it’s there in case you need it.

If that doesn’t help, I’ll have to leave it to someone else.

Yup, its showing 2.4 version installed
50%20AM

Ah, right. But there is no version called ‘2.4’; there is 2.4.0 and 2.4.1. You must have speficied ‘2.4’ rather than one of the version numbers installed. Try specifying one of these.

Edit: we know that 2.4.0 is supported, so try

rvm --default use 2.4.0

Any use?

No luck
11%20PM
Dint specified anything.

OK, I don’t think I’ll be able to help any further, sorry. One of the tech wizards will sort you out.

The first error response makes me wonder whether you’d installed RVM incorrectly, or whether your .bash_profile or .bashrc file is incorrectly set up. But I wouldn’t be able to advise how to identify or correct that, and I’m having trouble with my own dev setup, and haven’t been able to solve that!

Good luck, and I hope someone gets you there soon.

Thanks for ur efforts, will share the solution here if issue resolved.

It looks like you’re using rbenv instead of rvm (which is usually used with our setups), but I think it theoretically should work. I never used rbenv so I don’t know how it works. You can either try to install rvm (I have no idea if that conflicts with rbenv in some way?), or try to fix rbenv. Maybe rbenv doesn’t detect 2.4.1 as 2.4 (which is configured in our .ruby-version to automatically select the latest 2.4.x version with rvm), so you maybe can just select 2.4.1 manually, but I don’t know how to do this with rbenv.

34%20PM

It looks like it’s still trying to use rbenv instead of rvm, but I don’t know if rvm even works if rbenv is installed, looks like this conflicts. Can you set a manual version for rbenv?

10%20AM
Downgraded gem pg from 1.0.0 to 0.18.0 but still

Uninstalled rbenv. Using rvm now.

You shouldn’t downgrade any gems.

Since you’re using a mac, and I don’t know how up-to-date the mac guides are (and I don’t have a mac, so I can’t test or update the mac guides), you maybe should have a look at a default linux guide, and follow it from this point: https://wiki.diasporafoundation.org/Installation/Ubuntu/Xenial?db=postgres&mode=development#Bundle Maybe your bundler is just not configured correctly to activate the postgres gem.

Incompatibility of pg 1.0.0 with current rails version mentioned on stack.
31%20PM

Why shouldn’t it be compatible? It works perfectly on many pods and in our tests on travis.

Oh, looks like script/configure_bundler doesn’t work on mac (my bad, but I created a fix for that here), probably the reason why it isn’t in the mac guide. But you can do everything the script does by hand. So when you want to install a development installation with postgresql you can run this (everything else the script does is only relevant for production):

bin/bundle config --local with postgresql

18%20PM

Precompile
59%20PM

There’s no need to precompile assets for a development setup. That’s for a production setup (a working pod).

There are separate instructions for installing a dev setup (which is what you stated in your opening post): https://wiki.diasporafoundation.org/Installation/Backport?db=postgres&mode=development#Versions_of_this_guide

This version of this instructions assumes you’re using Postgres; if you’re using another database, you’ll need to select that.

Also, you’re on the master branch. For a development setup, you should pull the develop branch.

If you are trying to set up a production pod, you’ll need to alter the command to include RAILS_ENV=production. (The command in the installation instructions is slightly different to what is in your opening post; RAILS_ENV=production bin/rake db:create db:migrate. What you have written looks familiar, but I can’t find it in the installations instructions.)

while running ./script/server . The error

daemonizing: bin/bundle exec unicorn -c config/unicorn.rb with start_grace: 2.5s, env: ‘RAILS_ENV=development PORT=’, <1203> (in /Users/jagtarsingh/diaspora)