Need help with setting up dev platform

43 views
Skip to first unread message

Szymon Siewior

unread,
Nov 26, 2012, 2:50:14 PM11/26/12
to lagtv-...@googlegroups.com
Hey, 

I thought I would be able to handle this by following Andy's How To Install guide but failed and I need your help. 
To this point I managed to: 
- postgres 9.1 installed
- rvm, ruby, rails, gemset, bundler installed
- git configured and managed to fork the source (i still need a little help with git and the process of correctly pulling and submitting changes)
- stuck with creating db, when running rake db:create:all, rake says the version required is 0.9.2.2 and i have 10 something. Looked it up and tried this command: bundler exec rake db:migrate. This returned that there is no file lagtv/application.yml

I am running all of this on VM Ubuntu 12.10 and will be doing the coding there also. If it is easier to start of fresh I can always start with a blank snapshot of ubuntu and reinstall everything to eliminate missed steps, etc. This is my first attempt with running ruby + source from git. Most of the project I do locally so excuse me for stupid questions regarding git, etc.


Thanks!

Thongalong

unread,
Nov 26, 2012, 10:12:49 PM11/26/12
to lagtv-...@googlegroups.com
Hey szymon,

I'm not sure if you looked into this, but I found a step by step guide on Ubuntu 12.04 Ruby on Rails Development Environment on github. Hopefully, this helps you out.

szymc1o

unread,
Nov 26, 2012, 10:33:58 PM11/26/12
to lagtv-...@googlegroups.com
Looked at different guides but didn't think git would have some. Thanks Thong!

Thongalong

unread,
Nov 26, 2012, 10:47:51 PM11/26/12
to lagtv-...@googlegroups.com
No problem! Let me know how it goes! I'm sure all you have to do is replace the db, files, install gems and set up the postgres.

Ville Hellman

unread,
Nov 27, 2012, 4:14:18 AM11/27/12
to lagtv-...@googlegroups.com
Hey Szymon,

Do post here if you still have trouble getting the code running, I've set this up couple of times now so might be able to help. In terms of git things, I don't know what your level of experience with using git is but codeschool has an excellent free course that will teach the basics of git: http://www.codeschool.com/courses/try-git it is very basic but it's a nice gentle introduction. If you have any specific questions I'll try and keep my eye on here and answer any questions.

Thanks
.FxN

On Tue, Nov 27, 2012 at 3:47 AM, Thongalong <ludipro...@gmail.com> wrote:
No problem! Let me know how it goes! I'm sure all you have to do is replace the db, files, install gems and set up the postgres.



--
Twitter @efexen

Andy Pike

unread,
Nov 27, 2012, 8:24:46 AM11/27/12
to lagtv-...@googlegroups.com
What version of Ruby do you have installed? Sounds like you might have 1.9.3. Can you try it with 1.9.2?

szymc1o

unread,
Nov 27, 2012, 10:43:16 AM11/27/12
to lagtv-...@googlegroups.com
Yeah by default it is inatalling 1.9.3. But i did try it with the earlier version. Im almost done with the guide Thong suggested and i will reply with the results.

As far as git, i would say i am beginner but i will just google my way into it.

Thanks

szymc1o

unread,
Nov 28, 2012, 11:11:30 PM11/28/12
to lagtv-...@googlegroups.com
ok, i give up.

I'm stuck on this:
szymon@szymon-VirtualBox:~/lagtv$ rake db:create:all
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

Meanwhile I have it installed using: 
szymon@szymon-VirtualBox:~/lagtv$ gem install execjs
Successfully installed execjs-1.4.0
1 gem installed
Installing ri documentation for execjs-1.4.0...
Installing RDoc documentation for execjs-1.4.0...


I have ruby 1.9.2 as required, i just don't know what I am doing wrong. Please help.

Ville Hellman

unread,
Nov 29, 2012, 3:46:22 AM11/29/12
to lagtv-...@googlegroups.com
The quickest and most reliable way that I always get around this is usually by installing nodejs http://nodejs.org/ plus then you have nodejs to play around with as a bonus =o)

.FxN

szymc1o

unread,
Nov 29, 2012, 7:35:51 AM11/29/12
to lagtv-...@googlegroups.com
Thank you sir! Built it from source and works like a charm. I moved on to the next steps :
7. Create databases
  $ rake db:create:all
8. Copy the config file
  $ cp config/database.example.yml config/database.yml
  $ cp config/application.example.yml config/application.yml

I had to do 8 first then 7, finally when I run "rails s" I get:

szymon@szymon-VirtualBox:~/lagtv$ rails s => Booting WEBrick => Rails 3.2.6 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Unable to load configuration from /home/szymon/lagtv/config/newrelic.yml Exiting


Any ideas? Sorry to be such a pain with this ;\\

Ville Hellman

unread,
Nov 29, 2012, 7:41:57 AM11/29/12
to lagtv-...@googlegroups.com
Did you run this line?
cp config/newrelic.example.yml config/newrelic.yml

Its in the Readme but seems to be missing from the how to install document. I'll change 7 and 8 around and add the above line to the how to install doc as well.

.FxN

szymc1o

unread,
Nov 29, 2012, 11:40:07 AM11/29/12
to lagtv-...@googlegroups.com
That solved the last issue, but now I'm still stuck with rake db:create:all, it cannot create databases. It also said something about not supplying a password. I doubled checked pg_hba.conf and I have the line to allow connection without password and nothing else pertaining to local connections

local   all              all                                                       trust

When I connect to postgres  in shell (psql -U lagtv postgres), it works fine and I am able to create db. FxN if you have a solid guide for a different distro than I will take it. This way I won't have to take up your time with these questions. If all you are using osx then I can put in on VM and use that not a big deal.

Thanks!

Ville Hellman

unread,
Nov 29, 2012, 12:00:50 PM11/29/12
to lagtv-...@googlegroups.com
I do remember having a problem with getting PG to accept it without a password so I think I just added a password for the user and added it to the database.yml configuration file as it does not get checked it it's not a problem. Also I believe I had to defined something else in the pg_hba.conf file as well as just local. I'm currently using OSX and had less problems in this environment than I did previously on my linux box. Unfortunately can't remember what the fixes were and don't have  a distro specific guide, I think I found the solution after some Googling so the answer is definitely out there somewhere =o)

Sorry can't be more of a help, hope you get it working soon
.FxN

szymc1o

unread,
Nov 29, 2012, 12:37:48 PM11/29/12
to lagtv-...@googlegroups.com
Ok no problem I will test with passwords.

Thanks!

szymc1o

unread,
Nov 29, 2012, 7:12:47 PM11/29/12
to lagtv-...@googlegroups.com
Setting passwords worked.

But hey, yet another thing. After starting up rails s I am greeted by this:
Secret should be something secure, like "20b3f5c5ebb6cca50976fbac0690ca8e". 
The value you provided, "881a29cb89b82bc4a76...",
 is shorter than the minimum length of 30 characters

Google has nothing, at least that works. Most people suggest putting code into environment.rb that sets a secret but that just gives more errors.

I will give up on this and try again with OSX. Thanks for all the time guys!!! I hope OSX will do the trick.

Ville Hellman

unread,
Nov 29, 2012, 7:18:05 PM11/29/12
to lagtv-...@googlegroups.com
That's not a problem with your environment at all, in the application.yml file set the secret_token to any string that is over 30 characters long. The value in there has been concatenated so that the public github repository doesn't contain the secret_token used on live site. Locally when you're developing just set it to any 30+ char string, I think I just copied the existing string 4-5 times to make up a dummy one at home =o)

.FxN

Andy Pike

unread,
Nov 29, 2012, 7:18:55 PM11/29/12
to lagtv-...@googlegroups.com
Don't do that, you are almost there. In the terminal run

$ rake secret

This will generate a long secret that is used for salting. Then edit you application.yml file and replace the 881a29cb89b82bc4a76... With what was generated. Then try running the server again.

Sent from my iPad

Ville Hellman

unread,
Nov 29, 2012, 7:20:31 PM11/29/12
to lagtv-...@googlegroups.com
Ah didn't know about that, didn't think it was a problem when running locally though?

.FxN

szymc1o

unread,
Nov 29, 2012, 7:36:23 PM11/29/12
to lagtv-...@googlegroups.com
thanks. it worked. lol but the databases are empty (no tables).. so more errors.. Are tables created with "rake db:create:all" along with databases? God I feel like a total idiot here. 

szymc1o

unread,
Nov 29, 2012, 7:42:53 PM11/29/12
to lagtv-...@googlegroups.com
i think i got it with rake db:migrate .. FINALLY!!!

szymc1o

unread,
Nov 29, 2012, 7:58:52 PM11/29/12
to lagtv-...@googlegroups.com
I added some lines into how_to_install, still don't know how to work git. working on it.

1. Install Postgres and start the service
  $ brew install postgresql
  $ sudo apt-get postgresql-9.1 #ubuntu 12.*

2. Install RVM
  $ curl -L get.rvm.io | bash -s stable

2a. Install Ruby 1.9.2-p180
  $ rvm install 1.9.2-p180 #takes a while 
  $ rvm use 1.9.2-p180

3. Create a gemset called lagtv and use it
  $ rvm gemset create lagtv
  $ rvm gemset use lagtv

4. Install bundler
  $ gem install bundler
5. Fork the official repo and create a feature branch
  $ git checkout -b my_feature_branch
6. Create the db user
  $ psql -d postgres
   
  # for ubuntu

  $ sudo su postgres
  $ psql -d postgres

  postgres=# create role lagtv login createdb;
  postgres=# \q

  # ubuntu

  postgres=# create role lagtv login createdb password 'password';
  postgres=# \q

  If you get "psql: could not connect to server: Permission denied" error on Lion:
    * Open /etc/paths and move /usr/local/bin to the top and save. 
    * Restart Terminal

  If you get error about not sending pass called fe_sendauth: No Password Supplier
      * You need to configure your pg_hba.conf file to allow local connections to connect without password. Info on how to setup the file here: http://archives.postgresql.org/pgadmin-support/2007-02/msg00085.php

7. Copy the config file
  $ cp config/database.example.yml config/database.yml
  $ cp config/application.example.yml config/application.yml
  $ cp config/newrelic.example.yml config/newrelic.yml

8. Change password in config/database.yml if using ubuntu

9. Change secret in config/application.yml
  $ rake secret 
  copy the string into application.yml as the new secret

10. Create databases
  $ rake db:create:all
  $ rake db:migrate

11. Run the rails server
  $ rails s

11. Check the site is running in your browser
Reply all
Reply to author
Forward
0 new messages