scaffeinate / socify

:rocket: Socify is an open source social networking platform written in Ruby on Rails
http://socifyapp.herokuapp.com
GNU General Public License v2.0
375 stars 210 forks source link

Error #53

Closed augmen closed 7 years ago

augmen commented 7 years ago

After sucesfull installation of ROR and posgresQL : I have run the command 👍 git clone https://github.com/sudharti/socify cd socify bundle install

got this error

screen shot 2017-08-05 at 15 31 47

The i creat new sudo user by running 👍 adduser swap2 su - swap2 i dropped into

swap2@soucify As my instance name is socify

Than i tried to cd socify but didn't get it

Then i run the above mentioned command as sudo user 👍

sudo apt install ruby-bundler rake db:create got this error screen shot 2017-08-05 at 16 04 03 screen shot 2017-08-05 at 16 04 03

sudo apt install ruby-railties

i think i am going wrong . how to run the commands

bundle install rake db:create rails server

As sudo -user ? I hope that you got it.

I just added the rake gem gem install rake and run the command

bundle install

got this error

screen shot 2017-08-05 at 18 40 33

Try to install the rake from bundle install rake. But got this error

screen shot 2017-08-05 at 18 52 31

After installing rake and running the command rake db:create got this 👍 screen shot 2017-08-05 at 18 56 40

Thanks

scaffeinate commented 7 years ago

@augmen I think you are not understanding what rake is. You don't have to setuprake manually. It will be setup when you install rails.

You are getting the error because it's rake db:migrate not rake db:create. And also please don't run bundle commands using sudo. Your first screenshot indicates you are running as root(root@socify). Please create a user and install ruby and rails.

Looks like there is a mismatch between the bundler & ruby version of your system and the one specified in the Gemfile.

Try reinstalling ruby and rails. Use this https://gorails.com/setup/.

scaffeinate commented 7 years ago

@augmen This looks like a config problem on your system. Since it's not anything specific to the app itself am closing this issue. Please feel free to ask any questions in this thread.

augmen commented 7 years ago

I am using the Ruby 2.3.1 & Rails 5.1.3. Ok i got it rake db:migrate. You mean to create a sudo userand then instal ROR as sudo user ? is yes then please guide us on the commands guide if possible ? Thanks

scaffeinate commented 7 years ago

@augmen You can create a sudo user. I was just saying don't install ruby/rails as the root user or use sudo commands for rails/bundler specific commands.

augmen commented 7 years ago

@scaffeinate what is the sudo command for the bundle install ? as i was getting error not to run bundle install as root user.

scaffeinate commented 7 years ago

@augmen You aren't supposed to run it as root

augmen commented 7 years ago

@scaffeinate So run with sudo command or run as sudo user ?

scaffeinate commented 7 years ago

@augmen No just run without the sudo. And also not as the root user. Run it without any elevated privileges.

augmen commented 7 years ago

@scaffeinate i run it as bundle install and got this screen shot 2017-08-05 at 15 31 47

Please look @ bundle install command return. Any direct code

scaffeinate commented 7 years ago

@augmen Can't you see root@soucify. You are clearly as the root

augmen commented 7 years ago

@scaffeinate Yes which directory to change ? as not root user ? Shall i try by creating sudo user ? like this The i creat new sudo user by running 👍 adduser swap2 su - swap2 i dropped into

swap2@soucify

but i didn't get into app as sudo user?

scaffeinate commented 7 years ago

@augmen It's not the directory. You are logged in as the root user. Please create a new user and switch to it. Or did you use sudo su?

augmen commented 7 years ago

@scaffeinate Got it . Create a sudo user and sudo su then install ROR following the guide @ gorillas.com and then run bundle install. Thanks

scaffeinate commented 7 years ago

@augmen No. That's exactly what you aren't supposed to do. I asked you whether you did it to switch as the root user. Please create a new user(Not a root) then install ROR.

augmen commented 7 years ago

@scaffeinate to switch user i did -adduser - swap2 then su -swap2 to switch to non-root user. then sudo su & cd to switch to root user. As a non-root user you cannot cd socify ? therefore to run the bundle install command inside the cd socify you should use as root user !!. I am using the same gorails.com guide to setup the engine . Also tried the same with digital ocean one click ROR apps. But results are same.

scaffeinate commented 7 years ago

@augmen I am not sure what issue you are facing. Maybe use this guide to set your server up: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04. And use this to install: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-16-04. It's a step-by-step tutorial to get it up and running :)

scaffeinate commented 7 years ago

@augmen It's because you cloned the project as the root user and trying to access as a non-root user. Simple permission issue. I would suggest to go over the links and start over server setup. But it's up to you

augmen commented 7 years ago

ok i will try thanks appreciated

augmen commented 7 years ago

i switched to sudo user it looks like this. screen shot 2017-08-06 at 10 34 20

then i tries to clone install socify as non-root user git clone https://github.com/sudharti/socify got error Permission denied ?

augmen commented 7 years ago

i still fail ? do you have copy of your script / source code that you can share . will use AWS elastic beanstalk to launch the code directly ?

scaffeinate commented 7 years ago

@augmen I couldn't help but notice that you are trying to clone the project as a non-root user but in the /root directory(which is system directory and ofcourse restricted). I suggest you checkout the unix man-page first before trying to configure your env. And I don't have any script as such. All I had were the links I shared.

augmen commented 7 years ago

I succeeded & resolved the bundle install . But could not get the app live in browser local hosts 3000 . I run the command rails serve and got this screen shot 2017-08-08 at 14 22 28

scaffeinate commented 7 years ago

Localhost :rofl: :rofl:. Localhost indicates your local computer. https://en.wikipedia.org/wiki/Localhost. If you are starting on a server you need to access it through it's IP address or domain name if you have done a DNS mapping. I think it's best for you to read about web dev basics before trying to deploy.