Re: [Rails] Simple CMS to add a few pages to an existing site

2017-12-09 Thread Ben Edwards
Just a few pages. Not updated that often. Possibly a fee images. Think I will 
build it from scratch.  On reflection CMS seems a bit OTT. 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/262d3b06-45d4-462b-896a-af7e8b2a6265%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Simple CMS to add a few pages to an existing site

2017-12-09 Thread Ben Edwards
I'm not having much luck with RefinaryCMS (support channel not very active) 
so was wondering what to try next?   

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b7e1bbb6-e779-4c8f-8423-11866be93433%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Adding RefinaryCMS to existing site (devise/cancancan)

2017-12-02 Thread Ben Edwards
Hi, think the subject kind of says it all.  I have an existing site 
(https://eventpuddle.com/) and want to use RefinaryCMS to manage pages.  
The app uses devise/cancancan for user managment.  Be good to get some 
pointers as to how to do this.  I have looked at 
https://www.refinerycms.com/guides/with-an-existing-rails-app and it seems 
relativly stright forward to add RefinaryCMS to the app but what I am not 
sure about is how I get it to use devise/cancancan (or if this is a bad 
idea should I use the RefinaryCMS user managment/access.  Some pointers 
woruld be great. 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a1e040c7-4854-4b92-af70-bfac72eb1135%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] NewRelic replacement?

2017-11-29 Thread Ben Edwards
Have a look at zabbix.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/34b8fab2-8046-4cac-880d-9b6fe163449f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Problem with Active Query condition

2017-11-26 Thread Ben Edwards
Actualy you missed the main thisg, not saying whitch version of rails I was 
using.  I was using old syntax for 9I think 2.3) and was using rails 5.

On Tuesday, November 21, 2017 at 2:04:27 AM UTC, Hassan Schroeder wrote:
>
> On Mon, Nov 20, 2017 at 4:46 PM, Ben Edwards  > wrote: 
>
> > What am I doing wrong? 
>
> In order: 
>
> 1. not having a test for the method in the first place 
> 2. not showing us the complete code for that method 
> 3. not showing us the full log entry and stack trace 
>
> 😀 
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d16c06ba-2a46-4956-b7a1-908e24e4e5fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Installing rails on Android phone - is GNURoot Debion a good option

2017-11-26 Thread Ben Edwards
I have an old HTC m9 with a slightly busted screen and I want to use it as 
a rails test server.  I installed GNURoot Debian which gave me an almost 
full Linux system running within Android but it does not support users, 
everything is run as root.So was wondering if it was OK to run rails as 
root and if not has anybody got any advice about a better way to install 
Linux/rails on an n Android phone? 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/97f9a67b-d5e7-4db0-998f-44a2f290625c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Problem with Active Query condition

2017-11-20 Thread Ben Edwards
I have the following code for an active record condition in a controller

  @thus_section = Section.all( :conditions => [ "url_section = ?", 
params[:ssection] ] )

And when I try to goto to the webpage asociated with it I get the following 
error:

  ArgumentError in UpcomingEventsController#index 


  wrong number of arguments (given 1, expected 0)


I was using  http://guides.rubyonrails.org/active_record_querying.html to 
work out how to do it.


What am I doing wrong?





-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/c3564f0e-a8a8-4500-9b72-6dc913e4b1f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Turning URL varables into URLs

2017-10-15 Thread Ben Edwards
Aslo *http://localhost:3000/upcoming_events/cost* works but not 
*http://localhost:3000/upcoming_events/cost/cheapevents*.

On Sunday, October 15, 2017 at 6:50:08 PM UTC+1, Ben Edwards wrote:
>
> PS I also tried 
>
> get 'upcoming_events/cost', to: 'upcoming_events#index'
>
>
> On Sunday, October 15, 2017 at 6:49:10 PM UTC+1, Ben Edwards wrote:
>>
>> Great, thanks, almost there.  Mine is slightly different as its not based 
>> on CRUD, its a ruby view based on a SQL view.  So 
>>
>> get '/patients/:id', to: 'patients#show'
>>  
>>
>> Is not quite what I need.  If I have this view as root view (
>> http://domain.tld) and want to pass cost as a variable (
>> http://domain.tld?cost=cheapevents = http://domain.tld/cheapevents). Its 
>> the site root
>>
>> currently I have 
>>
>> root 'upcoming_events#index'
>>
>> *get* 'upcoming_events/index'
>>
>>
>> I tried
>>
>> *get* 'upcoming_events/index:cost', to: 'upcoming_events#index'
>>
>>
>> And it works for root but if I try *http://domain.tld/cheapevents 
>> <http://domain.tld/cheapevents>* I get 
>>
>> No route matches [GET] "/cheapevents"
>>
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d07b042a-de66-4ef0-b1c0-419eabe47baa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Turning URL varables into URLs

2017-10-15 Thread Ben Edwards
PS I also tried 

get 'upcoming_events/cost', to: 'upcoming_events#index'


On Sunday, October 15, 2017 at 6:49:10 PM UTC+1, Ben Edwards wrote:
>
> Great, thanks, almost there.  Mine is slightly different as its not based 
> on CRUD, its a ruby view based on a SQL view.  So 
>
> get '/patients/:id', to: 'patients#show'
>  
>
> Is not quite what I need.  If I have this view as root view (
> http://domain.tld) and want to pass cost as a variable (
> http://domain.tld?cost=cheapevents = http://domain.tld/cheapevents). Its 
> the site root
>
> currently I have 
>
> root 'upcoming_events#index'
>
> *get* 'upcoming_events/index'
>
>
> I tried
>
> *get* 'upcoming_events/index:cost', to: 'upcoming_events#index'
>
>
> And it works for root but if I try *http://domain.tld/cheapevents 
> <http://domain.tld/cheapevents>* I get 
>
> No route matches [GET] "/cheapevents"
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/c732fd97-440f-4e19-922f-4f8182d3d6b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Turning URL varables into URLs

2017-10-15 Thread Ben Edwards
Great, thanks, almost there.  Mine is slightly different as its not based 
on CRUD, its a ruby view based on a SQL view.  So 

get '/patients/:id', to: 'patients#show'
 

Is not quite what I need.  If I have this view as root view 
(http://domain.tld) and want to pass cost as a variable 
(http://domain.tld?cost=cheapevents = http://domain.tld/cheapevents). Its 
the site root

currently I have 

root 'upcoming_events#index'

*get* 'upcoming_events/index'


I tried

*get* 'upcoming_events/index:cost', to: 'upcoming_events#index'


And it works for root but if I try *http://domain.tld/cheapevents* I get 

No route matches [GET] "/cheapevents"





-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/65bc12ae-50da-4fb5-b111-0c19a9a49c30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: help with ransack / mysql performance

2017-10-15 Thread Ben Edwards
your like '%Tampa% will not use an index.  Looks like you are implementing 
some type of search.  For this type of free text search SQL is not a good 
option.  Elasticsearch is worth looking at or goodle for 'rails free text 
serach tools'.

Ben

On Thursday, October 12, 2017 at 3:17:04 PM UTC+1, der_tom wrote:
>
> hi,
>
> i am using ransack and i am experiencing slow queries, eg on the search 
> sites i have a query like that:
>
> SELECT DISTINCT COUNT(DISTINCT `tablename`.`id`) FROM `tablename` WHERE 
> (`tablename`.`city` LIKE '%Tampa%');
> ~5sec
>
> w/o distinct 
> ~ 6sec
>
> w/o distinct & w/o where
> ~4 sec
>
>
>
> what do you guys do? i reviewed all indexes, datatypes, memory is ok. no 
> overload.
>
> and yet i am feeling that i am missing something
>
> thx
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b2b49cc0-0d24-443b-881f-c04f9568d760%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Turning URL varables into URLs

2017-10-15 Thread Ben Edwards
OK, so I have a homepage and want the user to be able to select a link that 
goes back to it with a varable set.  Example here is the listings site 
lists all events regardless of price and I want users to be able to list 
events under ÂŁ5.  So I have a link https://eventpuddle.com?price=cheap.  
This is fine but for SEO reasons I want to have the URL something like 
https://eventpuddle.com/cheapevents.  Obviesly I could create another view 
but there are all sorts of things I will ultimatly want ot do this for.  
https://eventpuddle.com/jazz, https://eventpuddle.com/pucn, 
https://eventpuddle.com/art...  i would end up with LOTS of views and have 
to do code changes for eatch (see below).

I came across something years ago (I think in PHP)  where URLs got unpacked 
into varables in the background.  So 
https://eventpuddle.com/*price*/*cheapevents 
*was mapped in the background and created a varable *price *with a value 
*cheapevents*.

This will also be usefull for listing events for a certain venue, whitch I 
have lots.  Dont want to create a view for eatch venue as there are lots 
and I dont want to have to code stuff if I add venues, I simply add a row 
in the database for the new venue.  The kind of URLs I would be looking for 
is https://eventpuddle.com/venue/old-market-assembly or 
https://eventpuddle.com/venue/canteen.

Wondering if there is a way of doing this in rails or another way of 
handeling the same type of thing.


 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/797df844-344c-4445-904e-1732687a4199%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] source level debuggin

2017-10-15 Thread Ben Edwards
I have been using ruby mine I find the productivity gain is sugnificant.  
Mainly due to the source level debugging.  The main reason is you can 
easily look at the values for all the varables.  you dont have to decide 
whitch ones to look at and add print statements.  Using print statemenet I 
find i add a cople, do a run, then realise I need some more and add more

Aptana can also do source level debugging but I havent played with it.

Ben

On Monday, October 2, 2017 at 10:43:08 PM UTC+1, Hassan Schroeder wrote:
>
> On Mon, Oct 2, 2017 at 1:41 PM, Brendon  > wrote: 
>
> > I don't know where Hassan gets the statistics to support what most users 
> are 
> > doing, but I certainly know a lot of folks who wouldn't forgo the 
> > efficiencies of an IDE. 
>
> Of all the Rails developers I know personally there's *one* who 
> uses Rubymine. And that question has come up on the mailing 
> list over the years where lots of people have offered the same 
> response. 
>
> > makes it trivial to set a breakpoint in your Rails and then watch 
> values, 
> > step, etc. 
>
> Not sure how it could be appreciably easier than using `pry` but I'm 
> just not an IDE person. (And yes, I've tried Rubymine, Aptana, etc. 
> in the past and found they only slowed me down, so... whatevs.) 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a1571f76-f33c-49f1-885e-cd6257076a92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Enhancement idea: Throw error if index references a column that does not exist

2017-10-15 Thread Ben Edwards
Sqllite is not really apropreate fro production systems.  Personaly I would 
use Postgres, its performance is on par with MySQL and seems more robust 
and fully features.  i would imagine the mgrations can only throw errors 
from the database engine.  The fact that SQLlight does not throw an error 
is a good reason not to use it.

On Wednesday, October 11, 2017 at 9:58:54 PM UTC+1, John Moses wrote:
>
> I would like to discuss the idea of throwing an error if an index is added 
> in a migration that references a column that does not exist at the time of 
> migration.  Currently in MySQL, when you add an index on a column that does 
> not exist then MySQL will throw an error.  In SQLite, no error will be 
> thrown.  The error would be encountered by the user at runtime.
>
> Consider the following migrations:
>
> class CreateApplications < ActiveRecord::Migration[5.1]
>   def change
> create_table :applications do |t|
>   t.string :name
>
>
>   t.timestamps
> end
>   end
> end
>
> class CreateVersions < ActiveRecord::Migration[5.1]
>   def change
> create_table :versions do |t|
>   t.string :name
>   t.references :application, foreign_key: true
>   t.index [:application, :name], unique: true
>
>
>   t.timestamps
> end
>   end
> end
>
> Has this ever come up for anybody else?  I was considering my first 
> contribution to the code base and thought this might be a good addition, 
> but was hoping for a consensus before starting work.
>
> John
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/358d15d4-55b5-43da-a843-eae63eb5ccd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] source level debuggin

2017-10-01 Thread Ben Edwards
Bit of googeling show it seems to be possible to do source level debugging 
in Aptana but cant find setup instructions.  Can someone please point me in 
the correct direction.  Or if not be good to get info on IDEs where you 
can.  Ime currently using a RubyMine evaluation but was wondering if there 
was a FOSS solution.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a9877b58-c3b8-46b3-86b3-15bdf5fd5587%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] what on source level debuggers

2017-10-01 Thread Ben Edwards
Ime giving Rubymine a go but am shocked a goodle search on 'ruby source 
level debugger'  is close to useless.  Is it really true that if you want a 
good GUI IDE to do source level debugging you have to pay?

Was talking to a friend of mine who just got a job with mozilla and he 
knows they speed up development.  Using print statements is possible but 
wasts lots of time. 

Ben

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/0b122f32-9099-4d5f-89f0-d9122c77d076%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Moving reference date from staging to production

2017-10-01 Thread Ben Edwards


On Friday, September 29, 2017 at 5:48:15 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 29, 2017 at 8:55 AM, Ben Edwards  > wrote: 
>
> If your reference data is *not* immutable load-one-time-only then 
> your change/transform/whatever process should live and run on the 
> production server. 
>

Mine is!  Maybe I should call it something else but in my 25 years in IT 
i've worked on several projects that use data in a database to transform 
data and transformation change (i.e. data warehouse load scripts).  
 

>
> A "staging" server is for realistic testing of your *procedures* that will 
> run on production, not doing data transformation to export. 
>

Again, maybe we need to call the server something else.  Also it is testing 
(or the transformations).  

Anyway worked it out.  I simply reaload the reference tables.  The trick is 
to keep all the keys the same and use deferred foreign keys.

Rules are there to be broken;).

Ben


> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/4639cd62-ee08-4196-a2bb-b272768af9f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Moving reference date from staging to production

2017-09-29 Thread Ben Edwards
Using seed.rb, from what I can gather, can only add data (i.e. if record 
already exists it creates duplicates).  

The data transformation(table) will be changed fairly regularly (i.e. if I 
spot a venue listing that should not be included I define a transformation 
rather than delete it manually, this way if a similar thing happens again 
it will automatically be removed.  As the data comes from external listings 
sites and facebook groups the transformation will need constantly tweaking 
based observations.  It may be I have to do this by loading the data into 
staging tables and process them.  Just looking for some pointers.

Ben

On Friday, September 29, 2017 at 4:32:58 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 29, 2017 at 7:57 AM, Ben Edwards  > wrote: 
> > In my application I have reference data tables that I setup on my 
> staging 
> > server and then when it is tested I want to move it to production. 
>
> So use only the reference data to seed the production database. 
>
> Is this something you expect to have to do more than once? Will the 
> reference data change over time? If it's a one-off thing I'd probably 
> just do a DB dump of the relevant tables and be done with it... 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/30cbf996-c637-4828-a777-a58a0245adf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Set manually the created_at and updated_at attributes on object creation

2017-09-29 Thread Ben Edwards
And rightly so, it violates basic activerecord principles and may well 
break stuff.  

On Monday, September 25, 2017 at 6:22:12 AM UTC+1, Cassio Almeida wrote:
>
> Hey guys, how do I manually update created_at and updated_at attributes at 
> the time of object creation, I already know that this does not work:
>
> post = Post.new(
>   title: "Hello",
>   body: "Hello World!",
>   created_at: mycreatedate, 
>   updated_at: mychangedate
> )
>
> post.save
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7f79a784-eea8-4243-845d-7da94228d04b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Deploy rails app

2017-09-29 Thread Ben Edwards
Big thrums up for Digitalocean, great set of howtos.

On Monday, September 25, 2017 at 6:22:02 AM UTC+1, Diego Suarez wrote:
>
> For the server side Digitalocean got some good ones like 
> https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5
>
> For capistrano, the docs are great, google, stackoverflow... but yeah post 
> any specific questions.
>
> On Thursday, September 21, 2017 at 10:10:53 PM UTC-7, Aqib Hameed wrote:
>>
>> I want to deploy rails app  in OS centos 7, with Nginx, Unicorn and 
>> Capistrano so which guide or tutorials is best for deploying rails app ???  
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/382136a5-96d4-4510-a4d4-49b0ac19e90a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: Action mailer receive email

2017-09-29 Thread Ben Edwards
good point, deleted the post.

On Friday, September 29, 2017 at 4:20:56 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 29, 2017 at 8:10 AM, Ben Edwards  > wrote: 
> > Not read the guide but I simply set up the details of my outgoing SMTP 
> > server 
>
> which is completely irrelevant to the question of *receiving* mail... 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f522e8ee-51ae-4bfa-83e3-7ecd17517ff9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Action mailer receive email

2017-09-29 Thread Ben Edwards
Not read the guide but I simply set up the details of my outgoing SMTP 
server in my config/enviroments/production.rb (and development.rb), 
something like

  config.action_mailer.perform_deliveries = true
  config.action_mailer.smtp_settings = {
user_name:Rails.application.secrets.mail_username,
password: Rails.application.secrets.mail_password,
domain:   'mydomain.com',
address:  'mail.myhostingpeople.net',
port: '25',
authentication:   :login,
enable_starttls_auto: true
  }

Bear in mind that even  on development you need to restart 'rails s' to 
reload this.

The guide sounds a bit over complicate.  I setup my mail using the 
instructions in 
http://codepany.com/blog/rails-5-user-accounts-with-3-types-of-roles-devise-rails_admin-cancancan/.
  
Its actually a very good guide about setting up user/authentication but the 
mail bit can looked at on its own.

If you are using Linux and just want to send email ssmtp is worth a look, 
its VERY simple to set up (I use it on production servers).


On Thursday, September 28, 2017 at 8:36:43 AM UTC+1, Aqib Hameed wrote:
>
> I am following this rails guide 
> http://guides.rubyonrails.org/action_mailer_basics.html#receiving-emails. 
> But i am not able to understand what should it means
> "Configure your email server to forward emails from the address(es) you 
> would like your app to receive to /path/to/app/bin/rails runner 
> 'UserMailer.receive(STDIN.read)'."
> Is there any screen-cast which explain these things ???
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2727f738-e1c8-47e0-968d-7bc9835d8a3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Moving reference date from staging to production

2017-09-29 Thread Ben Edwards
In my application I have reference data tables that I setup on my staging 
server and then when it is tested I want to move it to production.  
Initially I thought 'rails db:seed:dump' may be useful but there are keys 
between reference data and the rest of the database so this probably wont 
work. My current research indicated I probably need to write a .rb script 
and use rails runner (rails run script.rb').  Wondering how best to 
approach this.

So some context probably best to give details of the specific application.  
Its a  listings site.  The main tables are venues and events.  It gets 
listings from venue websites (using web scraping) and facebook (using the 
graph API).  There is also a table called event_modifiers which holds 
details on transformations that need doing to the date.  These include not 
including where there is a certain event title (i.e. PRIVATE PARTY) and 
also has rules to try to work out the type of event (i.e. if title contains 
'CLUB NIGHT' set event_type = 'CLUB').  Some of these event_modifiers are 
global and some only for a specific venue.  This is a vast 
oversimplification of the application but should be enough to show what the 
challenges are in moving reference date.  One example is I there is a 
foreign key in event_modifiers that may point to a venue (rails 5 suports 
these optional associations).  There is also a foregn key between the 
events (non ref data) and venues (ref data).

So far it would be possible to simply truncate all the tables and reload 
the database (although this seems a bit drastic) but there is another 
issue.  However users (another table) can bookmark events so there is also 
a foregn key between user_bookmarks and events.  If I dropped the reference 
data the association between user_bookmarks, events and venues need keeping 
(the venue_id foreign key).

so this is far from trivial and some pointers would be good.






-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/90cbfa19-e233-40a6-80ef-70e4513049c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Working out size of strings made of varable width fonts.

2017-09-23 Thread Ben Edwards
Thanks. Will have a look but it's CSS cards using UL tag and flux-box. If I had 
realised it would be a CSS question I would of posted elsewhere.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7fc6f09f-af28-4675-9852-4a3017fa5a93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Working out size of strings made of varable width fonts.

2017-09-23 Thread Ben Edwards
I want to use this to put truncate stuff and put ... If a text string in 
too long.

I can work out how to do this in thery, with an array of chars and relative 
widths (for a specific font, in my case Helvitica) but can find details fo 
the widths anywhare.  Any ideas?


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/722f7d99-4dd1-4ab3-8aa6-cdfacb7f960c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Missing migration file

2017-09-23 Thread Ben Edwards
The are suposed to but probably best to use the scinic gem.  I had creating 
views without it working but when I tried to deplay alough migration did 
not error I had to add it manualy.  

On Friday, September 22, 2017 at 3:15:45 PM UTC+1, fugee ohu wrote:
>
>
>
> On Tuesday, September 5, 2017 at 8:17:28 PM UTC-4, Walter Lee Davis wrote:
>>
>> Have you run these migrations in production yet, or is it just in 
>> development? Because you can back your way out of this manually, but if you 
>> aren't careful, you can end up with things out of synch between your code 
>> and your actual database. The migrations and the schema_migrations table 
>> are a kind of "git" for your database. Speaking of which, can't you recover 
>> the missing migration file from a previous git commit or branch? 
>>
>> Assuming you cannot, and you are willing to live on the edge (which would 
>> be a pretty redundant statement if you were not running git, you will 
>> admit): 
>>
>> Manually delete (through SQL) the view that this migration would have 
>> created, if it exists, in all databases. 
>> Manually delete (through SQL) the row with the value '20170903000942' 
>> from the schema_migrations table. 
>>
>> Now it is as though that missing migration was never run and doesn't 
>> exist. 
>>
>> Walter 
>>
>> > On Sep 5, 2017, at 8:10 PM, Ben Edwards  wrote: 
>> > 
>> > I accidentally deleted a migration file and its up.  I looked in the 
>> development.log and it was to create  a view I don’t actually need. 
>> > 
>> > database: eventpuddle_development 
>> > 
>> >  Status   Migration IDMigration Name 
>> > -- 
>> >up 20170901234251  Create venues 
>> >up 20170902001958  Create ref values 
>> >up 20170902005356  Create events 
>> >up 20170902010547  Create logs 
>> >up 20170902125827  Fix column name 
>> >up 20170902184156  Add events fk 
>> >up 20170902190440  Add null constraints 
>> >up 20170903000942  ** NO FILE ** 
>> >up 20170903012041  Upcomming events 
>> >up 20170904191027  Devise create users 
>> >up 20170904215057  Add roles to users 
>> > 
>> > So what should I do? 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "Ruby on Rails: Talk" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to rubyonrails-ta...@googlegroups.com. 
>> > To post to this group, send email to rubyonra...@googlegroups.com. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/d438d78f-4484-49ec-83f6-6933d2dfaad4%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>   
>>
>
> > Manually delete (through SQL) the view that this migration would have 
> created, if it exists, in all databases.  
> Migrations create views? I didn't know that
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/940968d8-a510-4d38-b812-6fbee19a22a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] config.force_ssl = true problem

2017-09-18 Thread Ben Edwards
Hi.  My site has a certificate and if I go to https version it works fine.  
Problem is then I do 'config.force_ssl = true' I get an error, page does 
not load and it complains redirect is to somewhere that will not load.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/301ca7e0-f581-4758-a244-c91340afbe0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Testing rails SMTP settings (seems to be really hard)

2017-09-15 Thread Ben Edwards
OK, I realised what was wrong.  This was code I got from somewhere else and 
it does not actually send the email.  So I have done a direcrent version 
but still having problems.

irb(main):067:0* class MyMailer < ActionMailer::Base
irb(main):068:1>   def test_email
irb(main):069:2> @recipients  = “*meemail*@funkytwig.com”
irb(main):070:2> @from= “*otheremail*@eventpuddle.com”
irb(main):071:2> @subject = “This is a subject”
irb(main):072:2> @body= “This is the body”
irb(main):073:2> 
irb(main):074:2* mail(:to => @recipients, :subject => @subject, :body 
=> @body )
irb(main):075:2>   end
irb(main):076:1> end
=> :test_email
irb(main):077:0> 
irb(main):078:0* my_mailer = MyMailer.new
=> #>
irb(main):079:0> 
irb(main):080:0* my_mailer.delivery_method = :smtp
=> :smtp
irb(main):081:0> my_mailer.smtp_settings = {
irb(main):082:1* user_name:  '*user*',
irb(main):083:1* password:   '*pass*',
irb(main):084:1* domain: 'mail.xtreamlab.net',
irb(main):085:1* address:'mail.xtreamlab.net',
irb(main):086:1* port:   '25',
irb(main):087:1* authentication: :plain,
irb(main):088:1* enable_starttls_auto: true
irb(main):089:1> }
=> {:user_name=>"*user*", :password=>"*pass*", 
:domain=>"mail.xtreamlab.net", :address=>"mail.xtreamlab.net", :port=>"25", 
:authentication=>:plain, :enable_starttls_auto=>true}
irb(main):090:0> 
irb(main):091:0* my_mailer.test_email
NoMethodError: *undefined method `com”' for nil:NilClass*
from (irb):69:in `test_email'
from (irb):91
irb(main):092:0> 

Bit confused here, no idea what com is.

Ben

PS just posting the plain code below as it may be easier to read.

class MyMailer < ActionMailer::Base
  def test_email
@recipients  = “*meemail*@funkytwig.com”
@from= “*otheremail*@eventpuddle.com”
@subject = “This is a subject”
@body= “This is the body”

mail(:to => @recipients, :subject => @subject, :body => @body )
  end
end

my_mailer = MyMailer.new

my_mailer.delivery_method = :smtp
my_mailer.smtp_settings = {
user_name:  '*user*',
password:   '*pass*',
domain: 'mail.xtreamlab.net',
address:'mail.xtreamlab.net',
port:   '2525',
authentication: :plain,
enable_starttls_auto: true
}

my_mailer.test_email

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d9cc161f-45bb-41a4-bec7-4de3fbe2494e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] disabling user accounts

2017-09-15 Thread Ben Edwards
Saying that you could probably lock the account perminately  with some 
cleaver setup and a bit of SQL, which is almost not coding.

On Friday, September 15, 2017 at 9:50:29 PM UTC+1, Ben Edwards wrote:
>
> LOL, I just read the original message.  'without any additional coding' 
> seems to indicate the OP probably should not be using rails, with it being 
> an application framework rather than a drag and drop site builder.
>
> On Friday, September 15, 2017 at 1:29:55 PM UTC+1, Hassan Schroeder wrote:
>>
>> On Thu, Sep 14, 2017 at 5:25 AM, fugee ohu  wrote: 
>> > Does devise provide an already built in method for disabling user 
>> accounts 
>> > so I can disable accounts without any additional coding 
>>
>> Read the documentation for :lockable 
>>
>> That said, how exactly do you intend to "disable accounts"? From 
>> a console, through a form? You will have to do *some* coding to 
>> accomodate whatever approach(es) you choose. 
>>
>> -- 
>> Hassan Schroeder  hassan.s...@gmail.com 
>> twitter: @hassan 
>> Consulting Availability : Silicon Valley or remote 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d41313d6-0d2a-4217-8692-33bd314465c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] disabling user accounts

2017-09-15 Thread Ben Edwards
LOL, I just read the original message.  'without any additional coding' 
seems to indicate the OP probably should not be using rails, with it being 
an application framework rather than a drag and drop site builder.

On Friday, September 15, 2017 at 1:29:55 PM UTC+1, Hassan Schroeder wrote:
>
> On Thu, Sep 14, 2017 at 5:25 AM, fugee ohu  > wrote: 
> > Does devise provide an already built in method for disabling user 
> accounts 
> > so I can disable accounts without any additional coding 
>
> Read the documentation for :lockable 
>
> That said, how exactly do you intend to "disable accounts"? From 
> a console, through a form? You will have to do *some* coding to 
> accomodate whatever approach(es) you choose. 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b66621a1-787a-4b71-a654-2dc46ffa4ad6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Testing rails SMTP settings (seems to be really hard)

2017-09-15 Thread Ben Edwards
OK, been trying to get my SMTP settings correct in the action Mailer for 
about 4 hours now and running out of ideas.  The problem is that whatever I 
do I cant find any errors in logs but also don’t get any emails.  So I 
tried doing it in 'rails console', but still not getting any errors (or 
emails).  This is what I am doing in the console.  I should add I am doing 
this on my ISPs server (through ssh) and I use there SMTP server every day 
so I am fairly sure it is set up properly;)

Setting details up in ActionMailer

ActionMailer::Base.smtp_settings = {user_name:  '*username*',
password:   '*password*',
domain: 'mail.xtreamlab.net',
address:'mail.xtreamlab.net',
port:   '25',
authentication: :plain,
enable_starttls_auto: true
}

console response

=> {:user_name=>"*username*", :password=>"*password*", :domain=>"
mail.xtreamlab.net", :address=>"mail.xtreamlab.net", :port=>"993", 
:authentication=>:plain, :enable_starttls_auto=>true}

then I setup delivery method:

ActionMailer::Base.delivery_method = :smtp

console response

=> :smtp


and setup a method to send the email

class MyMailer < ActionMailer::Base
  def test_email
@recipients = “myaddr...@funkytwig.com”
@from = “someaddr...@eventpuddle.com”
@subject = “This is a subject”
@body = “This is the body”
  end
end

console response

=> :test_email


then tried to send the email

MyMailer.test_email


console response

MyMailer#test_email: processed outbound mail in 3.0ms
(Object doesn't support #inspect)
=> 


Looked in the rails log file and all seems OK.  so I thought maybe this is 
not actually telling me it has worked, so I changed the password to 
something random and very wrong and exactly the same happened, so it is not 
telling me it has worked.or giving me a error;(

I've tried this on my ISPs server and my development computer and I have 
run out of ideas, I really don’t know what to try next.






-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d5919c37-46a4-4052-89c8-506c8f0aa20f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] problem starting unicorn, says unicorn not installed but it is

2017-09-13 Thread Ben Edwards
User in unicorn.rb is ben.  When I am logged in as ben I can type unicorn 
and it finds/runs it.  Ime using rbenv.  I did have this working and 
reinstlled rbenv localy in the user.  sould of mentioned ths buy it was a 
2PAM post just before I caled it a day.  Will post config files later when 
I get home.

On Wednesday, September 13, 2017 at 8:30:23 AM UTC+1, Norbert Melzer wrote:
>
> Have you installed it for the correct user? Or locally to your current? 
>
> On Mi., 13. Sep. 2017, 03:12 Ben Edwards  > wrote:
>
>> Logfile is:
>>
>> ben@whatnow:~/eventpuddle/eventpuddle/rails/eventpuddle$ systemctl status 
>> unicorn_eventpuddle.service
>> ● unicorn_eventpuddle.service - LSB: starts the unicorn app server
>>Loaded: loaded (/etc/init.d/unicorn_eventpuddle; bad; vendor preset: 
>> enabled)
>>Active: failed (Result: exit-code) since Wed 2017-09-13 02:03:19 BST; 
>> 3min 2s ago
>>  Docs: man:systemd-sysv-generator(8)
>>   Process: 5386 ExecStart=/etc/init.d/unicorn_eventpuddle start 
>> (code=exited, status=127)
>>
>> Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: Starting eventpuddle
>> Sep 13 02:03:19 whatnow su[5388]: Successful su for ben by root
>> Sep 13 02:03:19 whatnow su[5388]: + ??? root:ben
>> Sep 13 02:03:19 whatnow su[5388]: pam_unix(su:session): session opened 
>> for user ben by (uid=0)
>> *Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: bundler: command not 
>> found: unicorn*
>> Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: Install missing gem 
>> executables with `bundle install`
>> Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Control 
>> process exited, code=exited status=127
>> Sep 13 02:03:19 whatnow systemd[1]: Failed to start LSB: starts the 
>> unicorn app server.
>> Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Unit 
>> entered failed state.
>> Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Failed 
>> with result 'exit-code'.
>> ben@whatnow:~/eventpuddle/eventpuddle/rails/eventpuddle$ 
>>
>> It says unicorn not found but it is. I have it in my Gemfile and I also 
>> installed it with 'gem install unicorn'.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-ta...@googlegroups.com .
>> To post to this group, send email to rubyonra...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/fcd2b2dc-7c21-4ddd-84ae-2e800446b603%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/rubyonrails-talk/fcd2b2dc-7c21-4ddd-84ae-2e800446b603%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/3abc15ba-cf73-4aab-b601-75fd4844761c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] problem starting unicorn, says unicorn not installed but it is

2017-09-12 Thread Ben Edwards
Logfile is:

ben@whatnow:~/eventpuddle/eventpuddle/rails/eventpuddle$ systemctl status 
unicorn_eventpuddle.service
● unicorn_eventpuddle.service - LSB: starts the unicorn app server
   Loaded: loaded (/etc/init.d/unicorn_eventpuddle; bad; vendor preset: 
enabled)
   Active: failed (Result: exit-code) since Wed 2017-09-13 02:03:19 BST; 
3min 2s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 5386 ExecStart=/etc/init.d/unicorn_eventpuddle start 
(code=exited, status=127)

Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: Starting eventpuddle
Sep 13 02:03:19 whatnow su[5388]: Successful su for ben by root
Sep 13 02:03:19 whatnow su[5388]: + ??? root:ben
Sep 13 02:03:19 whatnow su[5388]: pam_unix(su:session): session opened for 
user ben by (uid=0)
*Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: bundler: command not 
found: unicorn*
Sep 13 02:03:19 whatnow unicorn_eventpuddle[5386]: Install missing gem 
executables with `bundle install`
Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Control 
process exited, code=exited status=127
Sep 13 02:03:19 whatnow systemd[1]: Failed to start LSB: starts the unicorn 
app server.
Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Unit 
entered failed state.
Sep 13 02:03:19 whatnow systemd[1]: unicorn_eventpuddle.service: Failed 
with result 'exit-code'.
ben@whatnow:~/eventpuddle/eventpuddle/rails/eventpuddle$ 

It says unicorn not found but it is. I have it in my Gemfile and I also 
installed it with 'gem install unicorn'.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/fcd2b2dc-7c21-4ddd-84ae-2e800446b603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: routes

2017-09-12 Thread Ben Edwards
+1

post output from '$ rails routes', it will really help people  help you.

also 'NoMethodError in Gallery#new sounds like the new method is missing 
from the Gallery controller so posting that would also be good.

Ben

On Tuesday, September 12, 2017 at 3:23:21 PM UTC+1, Colin Law wrote:
>
> On 12 September 2017 at 15:15, Joe Guerra  > wrote: 
> > RIght, I tried resources galleries, resources gallerys 
> > 
> > But all come up with other errors.  My post controller and views work, 
> this 
> > gallery controller seems to look the same?  (I don't get it). 
>
> rails routes 
> will show you all configured routes, which may help 
>
> Colin 
>
> > 
> > Thanks, 
> > Joe 
> > 
> > On Tuesday, September 12, 2017 at 3:45:29 AM UTC-4, Norbert Melzer 
> wrote: 
> >> 
> >> Am 12.09.2017 um 03:15 schrieb Joe Guerra: 
> >> > get resources :gallery 
> >> You do have this in your routesfile literally? Seems invalid for me. 
> >> 
> >> Also As far as I can remember the convention, `resources` needs the 
> >> plural name, not the singular name. But I haven't used rails since 
> about 
> >> 3.x-ish. 
> >> 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Ruby on Rails: Talk" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to rubyonrails-ta...@googlegroups.com . 
> > To post to this group, send email to rubyonra...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/rubyonrails-talk/7846a77e-4bb0-42d0-aab8-f087843a30b2%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/90a4bc9f-950c-4ac0-8234-17cb58da2371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] unicorn/nginx rbdev seting ruby version

2017-09-12 Thread Ben Edwards
Thanks.  OK, so if I do rbenv local in my app directory will unicorn use 
that version to run unicorn when I do ' service unicorn_eventpuddle start '?

I was using ' ruby server' from bash on my dev box and had the following in 
my .bashrc so I used rbenv.

export RBENV_ROOT=/usr/local/rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"

So do I need to put this in the /etc/init.d/unicorn_appname script as it is 
run as root (I think).


Also wondering exactly how .ruby-version works.  I know 'rbenv local 3.2.1' 
creates it but when I do ruby stuff does it just look in the current 
directory for the file or does it traverse up the directory tree until it 
fins one? 

On Tuesday, September 12, 2017 at 8:48:52 PM UTC+1, Walter Lee Davis wrote:
>
> If you are in the directory containing the application, you can use the 
> rbenv local command to get and set the ruby version to use within the app. 
>
> rbenv local 3.2.1 
>
> will set the ruby version. It does this by creating or modifying a 
> .ruby-version file in the application root. 
>
> Walter 
>
> > On Sep 12, 2017, at 3:25 PM, Ben Edwards  > wrote: 
> > 
> > Hi, ive managed to get unicorn/nginx working (using 
> https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04)
>  
> and i am using rbenv.  The setup used a .rbenv-vars configuration file in 
> the ruby app directory.   what I cant figure out is how to specify what 
> version of ruby to tell it to use.  Ime ding this on my dev box, where I 
> only have one version but when I put it on prod they have several so I need 
> to specify which to use. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ruby on Rails: Talk" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to rubyonrails-ta...@googlegroups.com . 
> > To post to this group, send email to rubyonra...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/15d10ba9-f588-43ee-8184-cc27aa39f3f1%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/dd3b868e-54bd-4389-ab58-974e8dfe8bcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] unicorn/nginx rbdev seting ruby version

2017-09-12 Thread Ben Edwards
Hi, ive managed to get unicorn/nginx working (using 
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04)
 
and i am using rbenv.  The setup used a .rbenv-vars configuration file in 
the ruby app directory.   what I cant figure out is how to specify what 
version of ruby to tell it to use.  Ime ding this on my dev box, where I 
only have one version but when I put it on prod they have several so I need 
to specify which to use.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/15d10ba9-f588-43ee-8184-cc27aa39f3f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Receiving Email in rails

2017-09-11 Thread Ben Edwards
Think you need to have a look at ruby solution, which you can fold into 
rails, or use stand alone to populate a DB.  type something like 'ruby read 
emails -gmail' into your favourite search engine.  Not everything is solved 
by finding the right gem, sometimes you have to code stuff yourself.

On Sunday, September 10, 2017 at 7:28:14 AM UTC+1, Aqib Hameed wrote:
>
> I want to design a software which has multiple emails against the brands, 
> e.g Brand1 has email ema...@gmail.com , ema...@gmail.com 
> , and Brand2 has emails ema...@gmail.com , 
> ema...@gmail.com . So Customer send their query by email on 
> ema...@gmail.com  etc. So system  reads all emails against 
> the brands on which customer send the emails.So which Gem is best in rails 
> to reads the emails from multiple mailing box without forwarding the 
> emails??? 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1d113cb9-8ada-48a0-a39f-c4767e52d66e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: routes

2017-09-11 Thread Ben Edwards
Ineptitude;):  

Should be http://guides.rubyonrails.org/routing.html.

Ben

On Monday, September 11, 2017 at 6:33:09 PM UTC+1, Hassan Schroeder wrote:
>
> On Mon, Sep 11, 2017 at 10:16 AM, Ben Edwards  > wrote: 
>
> > http://guides.rubyonrails.org/v3.1.3/routing.html may help. 
>
> Uh, any particular reason to post a link to a guide for a version of 
> Rails that's been unsupported for a very long time? 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b33da801-ac97-438b-bae8-2e12c8327a1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Taking project from deveopment through test to production (worflow)

2017-09-11 Thread Ben Edwards
Thanks for that, stated looking at the testing guide but was confused as to 
how to setup the test database.  It seems it is talking about unit testing 
and does all the setup/pull down in the background.

https://www.google.com/url?q=https%3A%2F%2Frailstutorial.org&sa=D&sntz=1&usg=AFQjCNHycyJCw8I6pyES5ucJMACNfAHfrgHad
 
a glance through the rails guide and it looks great.  Shame I can just buy 
it, ime not a big fan of the subscription model.

Thansks,
Ben

On Sunday, September 10, 2017 at 7:45:43 PM UTC+1, Walter Lee Davis wrote:
>
>
> > On Sep 10, 2017, at 2:33 PM, Ben Edwards  > wrote: 
> > 
> > Thanks for your reply, 
> > 
> > I think I can work out most of the stuff but its the cloning the dev 
> (db) into test that I cant work out.  Seem to remember it saying something 
> in the ruby config  about the test database being re-writern from 
> development (not sure how/when) 
>
> If you have written migrations as you go, then the test database can be 
> created and structured by calling the following two rake commands: 
>
> rake db:create RAILS_ENV=test 
> rake db:migrate RAILS_ENV=test 
>
> If you have any seeds, then follow those with: 
>
> rake db:seed RAILS_ENV=test 
>
> I believe there are additional rake tasks specific to test setup that may 
> condense all of the above into a one-liner, you can see the entire list of 
> rake tasks by issuing this command (from within your rails project 
> directory: 
>
> rake -T 
>
> Your tests should not rely on any data besides what you add using seeds or 
> fixtures, as the test database may (should) be emptied and re-initialized 
> multiple times during a single testing run. So your comment about "cloning" 
> the dev DB into test may indicate that you need some more information about 
> how Rails tests run in general than you have at present. 
>
> A good first stop is here: http://guides.rubyonrails.org/testing.html and 
> if you haven't done so already, you should definitely take a couple of days 
> to work all the way through https://railstutorial.org which is free to 
> use online. If you haven't gone through this tutorial in the last two 
> years, you should probably do it again, too. I've been using Rails since 
> version 1, and I learned a few things the last time I went through it. 
> Hands-down, it is probably the best-written technical training material I 
> have ever used. 
>
> Walter 
>
> > 
> > More comments in-line below. 
> > 
> > On Sunday, September 10, 2017 at 6:05:04 PM UTC+1, Hassan Schroeder 
> wrote: 
> > On Sun, Sep 10, 2017 at 9:05 AM, Ben Edwards  
> wrote: 
> > > 've been googling for this for a while wit little joy.  Maybe I’m 
> using the 
> > > wrong search terms but I’m very surprised there is not a howto 
> guide;(, 
> > > 
> > > What I am trying to work out it how to take a project from development 
> to 
> > > test (and test) and then to production.   
> > 
> > Putting your app into production is usually called "deployment"; you 
> > should be able to find lots of references to that, but most Rails apps 
> > use Capistrano (highly recommended). 
> >   
> > Thanks,  deployment yes, in terms of Capistrano will look into it but 
> currently only have 5 pages and a lot of the data is loaded from outside 
> rails (the load scripts already existed).  In time will look into it.  I 
> feel better knowing how things work manually before going the automated 
> route. 
> > 
> > > Test 
> > > I've seen in a few places that I can basically clone by rails 
> development 
> > > environment to test (including database).  I gather this means going 
> to git 
> > > test branch and running some type of rails command to do this (not 
> sure what 
> > > or what I need to setup).   All I can work out is I need to setup 
> > > config/environments/test.rb/ & config/database.yml. 
> > 
> > "git test branch"? What? Running tests has nothing to do with any 
> > particular git branch. And ideally you'd be writing and running tests 
> > continually throughout development. 
> > 
> > Sorry 'git checkout test'.  I have develop, test and master branches. 
>  When I am ready to test for a release I merge develop into test.  Cant see 
> how I don’t want to be in test branch for testing or am I doing this all 
> wrong. 
> >   
> > > Exporting config Data 
> > > Bit more googling and I found out about 'rails db:seed:dump' 
> > > (http://www.rubydoc.info/gems/seed_dump/0.5.3). So I guess I use 
> something 
> > > like 
> >

Re: [Rails] Taking project from deveopment through test to production (worflow)

2017-09-11 Thread Ben Edwards
Thanks, so the testing database is used for unit testing (and I don’t have 
to worry about creating it/emptying as rails does this for me?).  I guess I 
was talking about integration testing, witch sounds like what people mean 
when they talk about staging.  Ive previously worked in telecoms doing 
Oracle DB development.  There they talked about integration testing, 
performance testing and unit testing.  

This is the first time ive taken something from development to production 
myself.  What I have currently is a single public page (based on a view) 
and some almost vanilla scaffold created screens. They set up configuration 
(XML feeds etc.) for a bunch of load scripts, that were writern previously 
in ruby (before I started looking at rails).  Also devise to protest them.  

The plan is to get it up as a proof of concept so people can look at it 
then start looking at testing in detail.

Thanks everyone for taking the time to reply, it is really appreciated.

On Sunday, September 10, 2017 at 8:04:20 PM UTC+1, Norbert Melzer wrote:
>
> On 09/10/2017 08:33 PM, Ben Edwards wrote: 
> > Sorry 'git checkout test'.  I have develop, test and master branches.  
> > When I am ready to test for a release I merge develop into test.  Cant 
> > see how I don’t want to be in test branch for testing or am I doing 
> > this all wrong. 
> This sounds like a concept known as “staging”. 
>
> Testing usually means having small pieces of code called unit-tests or 
> specs, which do test your code automatically. 
>
> Those tests are written iteratively and close in time to the code they 
> are testing and usually run in an environment similar to the 
> dev-environment. 
>
> The “staging” concept though, does run the same tests and optionally 
> additional manual tests, scripted or not, in an environment that is as 
> close as possible to the actual production environment. Hardware, 
> operating system, even the smallest system library version should be 
> identical to the prod environment. 
>
> Usually also some stresstrests are made in this environment to ensure 
> the application is capable to manage the expected load (or even more). 
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/daf196d4-0c3a-44b1-83ee-59c47dc2e9a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: routes

2017-09-11 Thread Ben Edwards
As Nobert says they are independent.  Post your routes.rb, where the view 
is you want the route to go to and say what you were expecting.  

http://guides.rubyonrails.org/v3.1.3/routing.html may help.

Also if you have not done so do the Getting started guide on the rails 
website.  See it through to the end.  I got confused half way when I did it 
but kept with it and its a great foundation.

I myself have a habit of just diving in and doing stuff. Knowing the 
conventions rails has and the rails way saves a lot of time in the medium 
term.

Ben

On Monday, September 11, 2017 at 6:05:12 PM UTC+1, Joe Guerra wrote:
>
> I believe I messed up the routes in one of my models.  
>
> Should I delete the model and try again?  
>
>
> Thanks,
> Joe
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b0ca31e7-d5c8-4e78-b54c-827eeb47e295%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Taking project from deveopment through test to production (worflow)

2017-09-10 Thread Ben Edwards
Thanks for your reply, 

I think I can work out most of the stuff but its the cloning the dev (db) 
into test that I cant work out.  Seem to remember it saying something in 
the ruby config  about the test database being re-writern from development 
(not sure how/when)

More comments in-line below.

On Sunday, September 10, 2017 at 6:05:04 PM UTC+1, Hassan Schroeder wrote:
>
> On Sun, Sep 10, 2017 at 9:05 AM, Ben Edwards  > wrote: 
> > 've been googling for this for a while wit little joy.  Maybe I’m using 
> the 
> > wrong search terms but I’m very surprised there is not a howto guide;(, 
> > 
> > What I am trying to work out it how to take a project from development 
> to 
> > test (and test) and then to production.  


> Putting your app into production is usually called "deployment"; you 
> should be able to find lots of references to that, but most Rails apps 
> use Capistrano (highly recommended). 
>
 
Thanks,  deployment yes, in terms of Capistrano will look into it but 
currently only have 5 pages and a lot of the data is loaded from outside 
rails (the load scripts already existed).  In time will look into it.  I 
feel better knowing how things work manually before going the automated 
route.

>
> > Test 
> > I've seen in a few places that I can basically clone by rails 
> development 
> > environment to test (including database).  I gather this means going to 
> git 
> > test branch and running some type of rails command to do this (not sure 
> what 
> > or what I need to setup).   All I can work out is I need to setup 
> > config/environments/test.rb/ & config/database.yml. 
>
> "git test branch"? What? Running tests has nothing to do with any 
> particular git branch. And ideally you'd be writing and running tests 
> continually throughout development. 
>

Sorry 'git checkout test'.  I have develop, test and master branches.  When 
I am ready to test for a release I merge develop into test.  Cant see how I 
don’t want to be in test branch for testing or am I doing this all wrong.
 

> > Exporting config Data 
> > Bit more googling and I found out about 'rails db:seed:dump' 
> > (http://www.rubydoc.info/gems/seed_dump/0.5.3). So I guess I use 
> something 
> > like 
> > 
> > rake db:seed:dump MODELS=User, RefValue 
>
> What are you calling "config data"? It's not usually something that's 
> associated with the DB. 
>
 
There are a few tables, i.e. one tells the data load scripts which XML 
feeds to use to load data and other data to do with music venues.  I prefer 
doing this as data input forms as it  means I can access the data easily 
from rails (venue name, address, phone number) and validate data.  Its data 
feed configuration which is setup by admins. Think seeds.rb is the answer 
here.
 
Ben

>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d706c6f4-2550-4c1f-a00e-a3f0ddaf8485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Taking project from deveopment through test to production (worflow)

2017-09-10 Thread Ben Edwards
've been googling for this for a while wit little joy.  Maybe I’m using the 
wrong search terms but I’m very surprised there is not a howto guide;(,

What I am trying to work out it how to take a project from development to 
test (and test) and then to production.  I will make the environments the 
same so I don’t need a staging environment. I am using git(bitbucket) 
unicorn, Nginx and rbevn. Currently I am actually using vanilla 'rails 
server' in development and realise I need to setup unicorn/Ngnix on my 
development box (but am not asking about this here as there seems to be 
good guides for this.

*Test*
I've seen in a few places that I can basically clone by rails development 
environment to test (including database).  I gather this means going to git 
test branch and running some type of rails command to do this (not sure 
what or what I need to setup).   All I can work out is I need to setup 
config/environments/test.rb/ & config/database.yml. Then run the tests  
(I'm looking at http://guides.rubyonrails.org/testing.html so again am not 
asking for help with testing).  


*Production*In production I have the following setup on the server (in 
.bashrc)

export RAILS_ENV=production
export APP_PATH=/home/users/funkytwig/user/rails/railsapp

I only have the master git branch on the production server (so I just need 
to 'git pull').

The first time I move app to production I will have to create the database 
(rails db:migrate? ro do I need to do something else to create from 
scratch).  Then I need to load some app configuration data, think I know 
how to do this, see below. 

Then when take a new version of the app I also do git pull, 'rails 
db:migrate' and reload the configuration data. 

*Exporting config Data*
Bit more googling and I found out about 'rails db:seed:dump' (
http://www.rubydoc.info/gems/seed_dump/0.5.3). So I guess I use something 
like

rake db:seed:dump MODELS=User, RefValue

Seem to make seance to create a  bump_db_app_config.bash to create this file, 
although not sure exactly where to put 
it in the file-system (should put the script and created file in rails app 
structure some-ware or outside it)

Lastly alter I have migrated the db I just run the script.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a850e1ee-74ea-485b-808a-8e4762385aad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Taking project from deveopment through test to production (worflow)

2017-09-10 Thread Ben Edwards
I've been googling for this for a while wit little joy.  Maybe I’m using 
the wrong search terms but I’m very surprised there is not a howto guide;(,

What I am trying to work out it how to take a project from development to 
test (and test) and then to production.  I will make the environments the 
same so I don’t need a staging environment. I am using git(bitbucket) 
unicorn, Nginx and rbevn. Currently I am actually using vanilla 'rails 
server' in development and realise I need to setup unicorn/Ngnix on my 
development box (but am not asking about this here as there seems to be 
good guides for this.

*Test*
I've seen in a few places that I can basically clone by rails development 
environment to test (including database).  I gather this means going to git 
test branch and running some type of rails command to do this (not sure 
what or what I need to setup).   All I can work out is I need to setup 
config/environments/test.rb/ & config/database.yml. Then run the tests  
(I'm looking at http://guides.rubyonrails.org/testing.html so again am not 
asking for help with testing).  


*Production*In production I have the following setup on the server (in 
.bashrc)

export RAILS_ENV=production
export APP_PATH=/home/users/funkytwig/user/rails/railsapp

I only have the master git branch on the production server (so I just need 
to 'git pull').

The first time I move app to production I will have to create the database 
(rails db:migrate? ro do I need to do something else to create from 
scratch).  Then I need to load some app configuration data, think I know 
how to do this, see below. 

Then when take a new version of the app I also do git pull, 'rails 
db:migrate' and reload the configuration data. 

*Exporting config Data*
Bit more googling and I found out about 'rails db:seed:dump' 
(http://www.rubydoc.info/gems/seed_dump/0.5.3). So I guess I use something 
like

rake db:seed:dump MODELS=User, RefValue

Seem to make seance to create a  bump_db_app_config.bash to create this file, 
although not sure exactly where to put it in the file-system (should put the 
script and created file in rails app structure some-ware or outside it)

Lastly alter I have migrated the db I just run the script.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/0af7f431-401e-4edc-b2cc-6e594af382ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Understanding scema_migrations schema.rb

2017-09-09 Thread Ben Edwards
No, I did run the migration, but just on development.  Guess I need to go 
the db:structure:load route (and make sure the deleted migration is not is 
schema.rb).  If I all my branches are in sync do I need to do a 'git reset 
--hard'.  If so I will read up what it does, makes my nervous running stuff 
i don’t fully understand that seems drastic.

On Friday, September 8, 2017 at 6:21:40 PM UTC+1, Christoph Lupprich wrote:
>
> Right, I missed the part where you said you didn't run the migration. In 
> that case, it's fine to just delete the migration file (which you did ;) ).
>
> On Friday, September 8, 2017 at 1:56:22 PM UTC+2, Ben Edwards wrote:
>>
>> Thanks, I do have scripts that backup the database, there is 
>> configuration data in there.  git reset --hard / db:structure:load seems a 
>> bit drastic.  It seems if I run db:schema:dump (and the view created by the 
>> lost migration is not in the DB) that would get things back in sync and 
>> effectively put the lost migration 'down' (or remove it altogether as I 
>> gather if a migration is down and you have not put it in production it is 
>> safe to delete the file).
>>
>> On Thursday, September 7, 2017 at 8:24:55 PM UTC+1, Christoph Lupprich 
>> wrote:
>>>
>>> Hi Ben!
>>>
>>> I can highly suggest the corresponding Rails Guide on this topic: 
>>> http://edgeguides.rubyonrails.org/active_record_migrations.html
>>>
>>> schema.rb contains the current structure of your database. When you 
>>> migrate up or down, schema.rb is updated and will always reflect the latest 
>>> state. You can also manually re-generate it by invoking the db:schema:dump 
>>> rake task.
>>> The individual migration files describe a change to your database 
>>> (removing/adding columns, adding/removing tables,...). Each migration has a 
>>> version number (which is a timestamp), and as soon as that migration is run 
>>> (up), Rails writes a new row into the schema_migrations with the timestamp 
>>> of the migration. When you down-migrate a migration, Rails deletes that row 
>>> from the schema_migrations table.
>>>
>>> Coming to your final question on how to best restore the state of your 
>>> database, without the missing migration: If you don't have any important 
>>> data in your database (i.e. it's just develop or test), I'd do a git reset 
>>> --hard (which will give you a clean HEAD), and then invoke the 
>>> db:structure:load rake task (which will delete the current structure of 
>>> your DB and replace it with what's defined in your schema.rb).
>>>
>>> On Thursday, September 7, 2017 at 7:49:23 PM UTC+2, Ben Edwards wrote:
>>>>
>>>> Hi, ime trying to get my head around how these interact as I acidentely 
>>>> deleted a migration and had not commited it to git.
>>>>
>>>> The migration is 'up'. So I did some research and it seems if I just 
>>>> delete the migration from the schema_migrations (and make sure the 
>>>> corresponding database object does not exist) will fix it. So I had a look 
>>>> at scema_migrations table and this got me wondering how rails knows if the 
>>>> migration is up or down, there is not status attribute on the table.
>>>>
>>>> So I did some more research and came across db/schema.rb, which rails 
>>>> used to work out if a migration is up or down. I looked in 
>>>> log/development.log to doble check what the migration was doing and found 
>>>> 'CREATE TABLE "create_report_upcoming_events" so I checked db/schema.rb 
>>>> and 
>>>> sure enough there is a reference to the view. This is not domething I want 
>>>> and it has not been put into production.  So it seems if I just delete the 
>>>> record from the scema_migrations table things will still be inconsistent.
>>>>
>>>>
>>>> So do I delete the row from schema_migrations and the reference to the 
>>>> view in db/schema.rb or will just deleting the migration from 
>>>> scema_migrations sufice?
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/e0186bfc-ffa9-4a78-863a-e9f06848f904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Understanding scema_migrations schema.rb

2017-09-08 Thread Ben Edwards
PS thanks for the link to the guide.  Have been looking through it.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/42dba9ea-dbf7-4772-b39d-75cd3701cd55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Understanding scema_migrations schema.rb

2017-09-08 Thread Ben Edwards
Thanks, I do have scripts that backup the database, there is configuration 
data in there.  git reset --hard / db:structure:load seems a bit drastic.  
It seems if I run db:schema:dump (and the view created by the lost 
migration is not in the DB) that would get things back in sync and 
effectively put the lost migration 'down' (or remove it altogether as I 
gather if a migration is down and you have not put it in production it is 
safe to delete the file).

On Thursday, September 7, 2017 at 8:24:55 PM UTC+1, Christoph Lupprich 
wrote:
>
> Hi Ben!
>
> I can highly suggest the corresponding Rails Guide on this topic: 
> http://edgeguides.rubyonrails.org/active_record_migrations.html
>
> schema.rb contains the current structure of your database. When you 
> migrate up or down, schema.rb is updated and will always reflect the latest 
> state. You can also manually re-generate it by invoking the db:schema:dump 
> rake task.
> The individual migration files describe a change to your database 
> (removing/adding columns, adding/removing tables,...). Each migration has a 
> version number (which is a timestamp), and as soon as that migration is run 
> (up), Rails writes a new row into the schema_migrations with the timestamp 
> of the migration. When you down-migrate a migration, Rails deletes that row 
> from the schema_migrations table.
>
> Coming to your final question on how to best restore the state of your 
> database, without the missing migration: If you don't have any important 
> data in your database (i.e. it's just develop or test), I'd do a git reset 
> --hard (which will give you a clean HEAD), and then invoke the 
> db:structure:load rake task (which will delete the current structure of 
> your DB and replace it with what's defined in your schema.rb).
>
> On Thursday, September 7, 2017 at 7:49:23 PM UTC+2, Ben Edwards wrote:
>>
>> Hi, ime trying to get my head around how these interact as I acidentely 
>> deleted a migration and had not commited it to git.
>>
>> The migration is 'up'. So I did some research and it seems if I just 
>> delete the migration from the schema_migrations (and make sure the 
>> corresponding database object does not exist) will fix it. So I had a look 
>> at scema_migrations table and this got me wondering how rails knows if the 
>> migration is up or down, there is not status attribute on the table.
>>
>> So I did some more research and came across db/schema.rb, which rails 
>> used to work out if a migration is up or down. I looked in 
>> log/development.log to doble check what the migration was doing and found 
>> 'CREATE TABLE "create_report_upcoming_events" so I checked db/schema.rb and 
>> sure enough there is a reference to the view. This is not domething I want 
>> and it has not been put into production.  So it seems if I just delete the 
>> record from the scema_migrations table things will still be inconsistent.
>>
>>
>> So do I delete the row from schema_migrations and the reference to the 
>> view in db/schema.rb or will just deleting the migration from 
>> scema_migrations sufice?
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d6b948f4-d5ae-4c81-baa0-2458bc622f86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Understanding scema_migrations schema.rb

2017-09-07 Thread Ben Edwards
Hi, ime trying to get my head around how these interact as I acidentely 
deleted a migration and had not commited it to git.

The migration is 'up'. So I did some research and it seems if I just delete 
the migration from the schema_migrations (and make sure the corresponding 
database object does not exist) will fix it. So I had a look at 
scema_migrations table and this got me wondering how rails knows if the 
migration is up or down, there is not status attribute on the table.

So I did some more research and came across db/schema.rb, which rails used 
to work out if a migration is up or down. I looked in log/development.log 
to doble check what the migration was doing and found 'CREATE TABLE 
"create_report_upcoming_events" so I checked db/schema.rb and sure enough 
there is a reference to the view. This is not domething I want and it has 
not been put into production.  So it seems if I just delete the record from 
the scema_migrations table things will still be inconsistent.


So do I delete the row from schema_migrations and the reference to the view 
in db/schema.rb or will just deleting the migration from scema_migrations 
sufice?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/bebc323e-f979-4598-b7eb-d155b2b9904e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Missing migration file

2017-09-06 Thread Ben Edwards
By pure I mean don’t have code in a remote repository that does not work, 
but if I keep it in a local one is is not an issue   Surrey if I run a 
migration and then delete the branch the migrations table will be out of 
sync.  I guess the answer is to be more careful:).  I guess backing up the 
DB first is another strategy.

On Wednesday, September 6, 2017 at 4:31:57 PM UTC+1, Hassan Schroeder wrote:
>
> On Wed, Sep 6, 2017 at 1:07 AM, Ben Edwards  > wrote: 
>
> > On the git front I don’t tend to commit stuff that does not work but I 
> guess 
> > if I create a local branch for stuff and don’t commit it remotely I can 
> > delete the branch and keep my remote git pure(ish) but the rails 
> database 
> > would still be unconsistent, or should I use a efferent git workflow. 
>
> "pure"? In general you'll be best off always working in a feature 
> branch and making frequent commits, especially for things like 
> migrations that have side effects. 
>
> And you can delete remote branches as well as local ones, so... 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d6ba86f7-29e8-46e3-bd90-fd8006db7c0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Missing migration file

2017-09-06 Thread Ben Edwards
PS changes are not in production.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/eaf3cf88-aa46-4490-b6e7-7f917fd7ff1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Missing migration file

2017-09-06 Thread Ben Edwards
Not sure why you thought I was not  using git.  Do you say deleting the 
view from the DB and the schema_migrations table is risky as you you think 
rails may hold the data about the migration somewhere else?  

On the git front I don’t tend to commit stuff that does not work but I 
guess if I create a local branch for stuff and don’t commit it remotely I 
can delete the branch and keep my remote git pure(ish) but the rails 
database would still be unconsistent, or should I use a efferent git 
workflow.

On Wednesday, September 6, 2017 at 1:17:28 AM UTC+1, Walter Lee Davis wrote:
>
> Have you run these migrations in production yet, or is it just in 
> development? Because you can back your way out of this manually, but if you 
> aren't careful, you can end up with things out of synch between your code 
> and your actual database. The migrations and the schema_migrations table 
> are a kind of "git" for your database. Speaking of which, can't you recover 
> the missing migration file from a previous git commit or branch? 
>
> Assuming you cannot, and you are willing to live on the edge (which would 
> be a pretty redundant statement if you were not running git, you will 
> admit): 
>
> Manually delete (through SQL) the view that this migration would have 
> created, if it exists, in all databases. 
> Manually delete (through SQL) the row with the value '20170903000942' from 
> the schema_migrations table. 
>
> Now it is as though that missing migration was never run and doesn't 
> exist. 
>
> Walter 
>
> > On Sep 5, 2017, at 8:10 PM, Ben Edwards  > wrote: 
> > 
> > I accidentally deleted a migration file and its up.  I looked in the 
> development.log and it was to create  a view I don’t actually need. 
> > 
> > database: eventpuddle_development 
> > 
> >  Status   Migration IDMigration Name 
> > -- 
> >up 20170901234251  Create venues 
> >up 20170902001958  Create ref values 
> >up 20170902005356  Create events 
> >up 20170902010547  Create logs 
> >up 20170902125827  Fix column name 
> >up 20170902184156  Add events fk 
> >up 20170902190440  Add null constraints 
> >up 20170903000942  ** NO FILE ** 
> >up 20170903012041  Upcomming events 
> >up 20170904191027  Devise create users 
> >up 20170904215057  Add roles to users 
> > 
> > So what should I do? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ruby on Rails: Talk" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to rubyonrails-ta...@googlegroups.com . 
> > To post to this group, send email to rubyonra...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/d438d78f-4484-49ec-83f6-6933d2dfaad4%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f858f4ed-935e-462a-9b34-3eb52645a185%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Missing migration file

2017-09-05 Thread Ben Edwards
PS I haven’t actually deployed anything to production.  I do want to this 
week which is why I want to sort this out.

On Wednesday, September 6, 2017 at 1:10:24 AM UTC+1, Ben Edwards wrote:
>
> I accidentally deleted a migration file and its up.  I looked in the 
> development.log and it was to create  a view I don’t actually need.
>
> database: eventpuddle_development
>
>  Status   Migration IDMigration Name
> --
>up 20170901234251  Create venues
>up 20170902001958  Create ref values
>up 20170902005356  Create events
>up 20170902010547  Create logs
>up 20170902125827  Fix column name
>up 20170902184156  Add events fk
>up 20170902190440  Add null constraints
>up 20170903000942  ** NO FILE **
>up 20170903012041  Upcomming events
>up 20170904191027  Devise create users
>up 20170904215057  Add roles to users
>
> So what should I do?
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/834bfc0b-72f3-4e5c-af4d-22172ebb0d1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Missing migration file

2017-09-05 Thread Ben Edwards
I accidentally deleted a migration file and its up.  I looked in the 
development.log and it was to create  a view I don’t actually need.

database: eventpuddle_development

 Status   Migration IDMigration Name
--
   up 20170901234251  Create venues
   up 20170902001958  Create ref values
   up 20170902005356  Create events
   up 20170902010547  Create logs
   up 20170902125827  Fix column name
   up 20170902184156  Add events fk
   up 20170902190440  Add null constraints
   up 20170903000942  ** NO FILE **
   up 20170903012041  Upcomming events
   up 20170904191027  Devise create users
   up 20170904215057  Add roles to users

So what should I do?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d438d78f-4484-49ec-83f6-6933d2dfaad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Using views as a backend for rails

2017-09-05 Thread Ben Edwards
Thanks, that worked.  how come all the other controllers index action for 
everything else are empty?  

On Sunday, September 3, 2017 at 7:40:58 AM UTC+1, Christoph Lupprich wrote:
>
> In your CurrentEvents controller's index action you need to query for 
> events, e.g.
>
> class CurrentEventsController < ApplicationController
>   def index
> @current_events = CurrentEvent.limit(100
>   end
> end
>
> On Sunday, September 3, 2017 at 4:26:42 AM UTC+2, Ben Edwards wrote:
>>
>> Ive been reading quite a few guides on this and my first attempt was not 
>> successful.  What I have done so far is writern n a migration for the view 
>> and got that working:
>>
>> class UpcommingEvents < ActiveRecord::Migration[5.1]
>>   def up
>> self.connection.execute %Q( CREATE OR REPLACE VIEW upcoming_events AS
>>SELECT   v.name "Venue",
>> to_char(e.start_date,'Day') "Day",
>> e.start_time,
>> e.title "Event",
>> e.description
>> FROMevents e,
>> venues v
>> WHERE   v.id = e.venue_id
>> AND e.start_date
>> BETWEEN (CURRENT_DATE -INTERVAL '1 day')::date
>> AND (CURRENT_DATE + INTERVAL '7 day')::date
>> order by start_date, v.name
>> )
>>   end
>>
>>   def down
>> execute "DROP VIEW upcoming_events"
>>   end
>> end
>>
>> Created a controller:
>>
>> class CurrentEventsController < ApplicationController
>>   def index
>>   end
>> end
>>
>> And a Model
>>
>> class CurrentEvent < ApplicationRecord
>> end
>>
>> And a View
>>
>> <%= notice %>
>>
>> Current_Events
>>
>> 
>>   
>> 
>>   Venue
>>   Day
>>   Start Time
>>   Event
>>   Description
>>   
>> 
>>   
>>
>>   
>> <% current_event.each do |ce| %>
>>   
>> <%= ce.venue %>
>> <%= ce.day %>
>> <%= ce.start_time %>
>> <%= ce.event %>
>> <%= ce.description %>
>>   
>> <% end %>
>>   
>> 
>>
>> 
>>
>> Bit when I add it as a route and browse  to the page I get
>>
>> NameError in CurrentEvents#index 
>>
>> Showing 
>> */home/ben/eventpuddle/eventpuddle/rails/eventpuddle/app/views/current_events/index.html.erb*
>>  
>> where line *#18* raised: 
>>
>> undefined local variable or method `current_event' for 
>> #<#:0x007f648d40ba48>
>> Did you mean?  current_events_index_url
>>
>> Extracted source (around line *#18*):
>>   
>>
>> 17  
>> 18 <% current_event.each do |ce| %> 
>> 19  
>> 20 <%= ce.venue %> 
>> 21 <%= ce.day %> 
>>
>> Rails.root: /home/ben/eventpuddle/eventpuddle/rails/eventpuddle
>>
>>
>> I also added to config/application.rb 
>>
>>
>> config.active_record.schema_format = :sql
>>
>> and run 'rake db:migrate db:test:prepare'
>>
>> Not sure where I am going wrong;(.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/ca34f18b-9004-4d0c-a905-8850d1aa49f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Using views as a backend for rails

2017-09-02 Thread Ben Edwards
Just noticed and error in the view, should of been

<% @current_events.each do |ce| %>

Now getting a different error:

undefined method `each' for nil:NilClass


On Sunday, September 3, 2017 at 3:26:42 AM UTC+1, Ben Edwards wrote:
>
> Ive been reading quite a few guides on this and my first attempt was not 
> successful.  What I have done so far is writern n a migration for the view 
> and got that working:
>
> class UpcommingEvents < ActiveRecord::Migration[5.1]
>   def up
> self.connection.execute %Q( CREATE OR REPLACE VIEW upcoming_events AS
>SELECT   v.name "Venue",
> to_char(e.start_date,'Day') "Day",
> e.start_time,
> e.title "Event",
> e.description
> FROMevents e,
> venues v
> WHERE   v.id = e.venue_id
> AND e.start_date
> BETWEEN (CURRENT_DATE -INTERVAL '1 day')::date
> AND (CURRENT_DATE + INTERVAL '7 day')::date
> order by start_date, v.name
> )
>   end
>
>   def down
> execute "DROP VIEW upcoming_events"
>   end
> end
>
> Created a controller:
>
> class CurrentEventsController < ApplicationController
>   def index
>   end
> end
>
> And a Model
>
> class CurrentEvent < ApplicationRecord
> end
>
> And a View
>
> <%= notice %>
>
> Current_Events
>
> 
>   
> 
>   Venue
>   Day
>   Start Time
>   Event
>   Description
>   
> 
>   
>
>   
> <% current_event.each do |ce| %>
>   
> <%= ce.venue %>
> <%= ce.day %>
> <%= ce.start_time %>
> <%= ce.event %>
> <%= ce.description %>
>   
> <% end %>
>   
> 
>
> 
>
> Bit when I add it as a route and browse  to the page I get
>
> NameError in CurrentEvents#index 
>
> Showing 
> */home/ben/eventpuddle/eventpuddle/rails/eventpuddle/app/views/current_events/index.html.erb*
>  
> where line *#18* raised: 
>
> undefined local variable or method `current_event' for 
> #<#:0x007f648d40ba48>
> Did you mean?  current_events_index_url
>
> Extracted source (around line *#18*):
>   
>
> 17  
> 18 <% current_event.each do |ce| %> 
> 19  
> 20 <%= ce.venue %> 
> 21 <%= ce.day %> 
>
> Rails.root: /home/ben/eventpuddle/eventpuddle/rails/eventpuddle
>
>
> I also added to config/application.rb 
>
>
> config.active_record.schema_format = :sql
>
> and run 'rake db:migrate db:test:prepare'
>
> Not sure where I am going wrong;(.
>
>
>
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/46781f75-44a1-45f9-92d7-86b112076d97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Using views as a backend for rails

2017-09-02 Thread Ben Edwards
Ive been reading quite a few guides on this and my first attempt was not 
successful.  What I have done so far is writern n a migration for the view 
and got that working:

class UpcommingEvents < ActiveRecord::Migration[5.1]
  def up
self.connection.execute %Q( CREATE OR REPLACE VIEW upcoming_events AS
   SELECT   v.name "Venue",
to_char(e.start_date,'Day') "Day",
e.start_time,
e.title "Event",
e.description
FROMevents e,
venues v
WHERE   v.id = e.venue_id
AND e.start_date
BETWEEN (CURRENT_DATE -INTERVAL '1 day')::date
AND (CURRENT_DATE + INTERVAL '7 day')::date
order by start_date, v.name
)
  end

  def down
execute "DROP VIEW upcoming_events"
  end
end

Created a controller:

class CurrentEventsController < ApplicationController
  def index
  end
end

And a Model

class CurrentEvent < ApplicationRecord
end

And a View

<%= notice %>

Current_Events


  

  Venue
  Day
  Start Time
  Event
  Description
  

  

  
<% current_event.each do |ce| %>
  
<%= ce.venue %>
<%= ce.day %>
<%= ce.start_time %>
<%= ce.event %>
<%= ce.description %>
  
<% end %>
  




Bit when I add it as a route and browse  to the page I get

NameError in CurrentEvents#index 

Showing 
*/home/ben/eventpuddle/eventpuddle/rails/eventpuddle/app/views/current_events/index.html.erb*
 
where line *#18* raised: 

undefined local variable or method `current_event' for 
#<#:0x007f648d40ba48>
Did you mean?  current_events_index_url

Extracted source (around line *#18*):
  

17  
18 <% current_event.each do |ce| %> 
19  
20 <%= ce.venue %> 
21 <%= ce.day %> 

Rails.root: /home/ben/eventpuddle/eventpuddle/rails/eventpuddle


I also added to config/application.rb 


config.active_record.schema_format = :sql

and run 'rake db:migrate db:test:prepare'

Not sure where I am going wrong;(.










-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/3bea81a3-91fd-480d-8076-0a315df90a3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Moving stand alone scripts into rails, architecture

2017-09-02 Thread Ben Edwards


On Saturday, September 2, 2017 at 5:05:10 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 1, 2017 at 6:50 PM, Ben Edwards  > wrote: 
>
> > So do I put the venue and event methods in to controllers or is there 
> > somewhere else.  The venue and event classes map to tables which is why 
> this 
> > seems the way to go.I want to put them into rails so I can use 
> > ActiveRecords, and also because it feels like the correct thing to do? 
>  I 
> > then need to work out how to change the setters in Active record, or 
> maybe 
> > not, but at the moment I simply am trying to work out where the methods 
> go. 
>
> Uh. That whole paragraph is such a mish-mash that it leads to me 
> believe that you don't have a clear picture of the MVC pattern that 
> Rails embodies. 
>
> Foe one thing, classes ("models") derived from ActiveRecord are 
> just that, models, *not* controllers. Controllers do not "map to tables". 
>
> You might want to, as Colin suggested, run through a tutorial before 
> going any further. 
>
> Then decide if it makes sense to combine your data import function 
> with the Rails *data display* function. 
>

I get the MVC pattern now, but I did not when I wrote the stand alone 
scripts (I started by reacquainting myself with ruby and writing the batch 
processing).  Basally I was trying to get my head around how, if at all, 
its best to do data loading and manipulation in rails.  It seems very 
geared towards data input in forms.  Ime sure there is a good way of doing 
it, just wondering if there is some guides about how to do it.  Ime also 
thinking from a OO perspective there should be a VenueWebsite object so 
rather than collecting and manipulating the events in the Venue object it 
should be a separate class.

Anyway learning ruby and rails is enough for now. As the scripts work well 
so I've decided to park looking at moving them into rails until I know it 
better.

Thanks for everyone’s help.
 

>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/c5fe832b-95cb-44ba-bde1-9413dffd0f1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Moving stand alone scripts into rails, architecture

2017-09-02 Thread Ben Edwards
Yes, I'me building a website that lists what’s on at local venues.  Others 
have suggested I move the scripts into rails and using ActiveRecords 
certainly appals to me.  Ime very open to suggestions/advice and if I can 
use ActiveRecord and the models from my ruby app, and keep the scripts 
stand alone that may be a way to go.

I am using terms like outside rails and stand alone but this may be the 
wrong terminology.   It just seems logical to have access to rails 
infrastructure and put stuff there so there is not duplication, or I could 
use the rals infrastructure and have the batch processing classes separate, 
wit the scripts using both.

Maybe I should be asking a more genital question lets give it a go:

If you have a rails app you are primevally using to display data collected 
by web scraping scripts and want to leverage the rails framework 
(ActiveRecords and anything else that is useful) to batch import data. How 
should I do this architecturally.  Is there any documentation/guides/howtos 
that discuss this.  I am tuning data into information.

I already have classes I have written to-do this that have them working as 
stand alone .rb.  It seems logical to move the methods into rails and 
extend the ActiviveRecord classes etc.   This may involve restructuring the 
object model but using the methods. 

Broadly speaking the three things 

   1. I am doing is scraping the data from websites (and loading the data 
   into arrays to represent the data on these websites).
   2. Processing this data (the arrays) from the formats the websites has 
   to a standard format (i.e. turning the various ways times are from the 
   website to HH:MM).  Also spiting up data (often there’s a string that has 
   the date and time and this needs splinting up to date and time).
   3. Cleaning the data, removing white-space, trailing/leading spaces etc.
   4. Writing the data to a table.

rails runner has been suggested as part of the solution.

Regards,
Ben






-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/3974567e-9794-4e30-bddb-78f6f9ca384c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Moving stand alone scripts into rails, architecture

2017-09-01 Thread Ben Edwards
This is going to be a bit of a long one;)

I have a bunch of stand alone scripts that I want to move into rails.  They 
are batch scripts that update the database (run from cron).  Where I live 
the music listings websites are very incomplete so I am using web scrapers 
to collect listings for a listings website.  They are very gently, fetching 
a page every 15 seconds.  There is a .rb script for each venue.

Basically I have three main classes, scrape, venue and event, the later 2 
having corresponding tables. I have used scaffold to create the tables in a 
postgres database, now I need to work out where to put the methods.  The 
scrape one does not need access to the database but the venue and events 
ones do.  I was planing on punting scrape class in a module in lib, there 
will be other classes eventually but for now the module will probably only 
have the one.

This is basically how it works:

The *Venue* class has arrays for all the attributes needed for events 
(title, date, time, description...), it used the *Scrape* class to collect 
the raw data for events.  

The venue arrays are then looped through and loaded into the *Event* class 
which interprets the raw data and writes the event record.  It uses a lot 
of setters, so when, for example, the time is set it is interpreted into a 
HH:MM format (it can be 10am, 1030am, 1030, 10:30...).  There are lots of 
other loose/fuzzy formatted data for events and this is all interpreted 
using setter.  I am not saying this architecture is correct  but it works.  

As an aside I also clean the data as there are lots of white-space 
characters.

The first step is to move stuff into rails, at a later date I may change 
things but for now I just want to get it working in a smeller way to the 
currently functioning stand alone scripts.  I will be using rails runner 
from cron to schedule the scripts.

So do I put the venue and event methods in to controllers or is there 
somewhere else.  The venue and event classes map to tables which is why 
this seems the way to go.I want to put them into rails so I can use 
ActiveRecords, and also because it feels like the correct thing to do?  I 
then need to work out how to change the setters in Active record, or maybe 
not, but at the moment I simply am trying to work out where the methods go.



 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/571a90ce-dba7-4af3-a200-5748a7ba1968%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Inttegrating existing rb scripts into rails.

2017-09-01 Thread Ben Edwards
Thanks, for the record the scripts are just run once a day, then only get a 
web page every 15 seconds, once up and running they do very little.

In Linux, so could not run a script every 15 seconds via cron.

On Friday, September 1, 2017 at 9:33:19 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 1, 2017 at 12:02 PM, Ben Edwards  > wrote: 
>
> > Now a bit of context is probably needed.  I will have quite a lot of 
> scripts 
> > (possibly 40, each one is a web scraper).  They do very gentle scraping 
> > (i.e. a http request every 15 seconds) so currently I run them 
> concurrently 
> > using cron. 
>
> Out of curiousity -- what OS are you using that gives you sub-minute 
> granularity for cron? 
>
> > Doing this all within rails seems a great idea but I am worried 
> > about the (resource) cost of doing this (initializing 40 rails 
> environments) 
> > will be quite high.  Did some googeling and could not find out what the 
> cost 
> > is.  Don't want to put undue stress on the server so although I like the 
> > ideal it may be better to keep them as separate stand alone scripts 
> outside 
> > rails.  Like I said I would rather run them inside rails.  What so you 
> > think? 
>
> Depends on the server, but yes, starting 40 full rails environments 
> every 15 seconds seems like a bad idea. At this point, you should 
> probably be thinking in terms of background jobs. Or leaving them 
> as standalone scripts. 
>
> A lot depends on the details -- how close to exact that 15 seconds 
> needs to be, how to handle timeouts, what you're doing with the data 
> they're collecting, etc. 
>
> But set it up, try it, see how it goes :-) 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7677ee10-0f3d-4f53-8f8e-bcb39506dc8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Inttegrating existing rb scripts into rails.

2017-09-01 Thread Ben Edwards
On Friday, September 1, 2017 at 7:31:14 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 1, 2017 at 11:00 AM, Ben Edwards  > wrote: 
>
> > So I take it I need to run this from the rails app directory? Where 
> should I 
> > put the scripts, vendor maybe? 
>
> I normally put them in the /lib directory. 
>

Yes, that was what I thought (after a bit more googling).  Would it be OK 
to create a scripts directory under lib to put the ,rb scripts in.   Also  
I have a module, so I guess I should put this in lib/modulename¡

Now a bit of context is probably needed.  I will have quite a lot of 
scripts (possibly 40, each one is a web scraper).  They do very gentle 
scraping (i.e. a http request every 15 seconds) so currently I run them 
concurrently using cron.  Doing this all within rails seems a great idea 
but I am worried about the (resource) cost of doing this (initializing 40 
rails environments) will be quite high.  Did some googeling and could not 
find out what the cost is.  Don't want to put undue stress on the server so 
although I like the ideal it may be better to keep them as separate stand 
alone scripts outside rails.  Like I said I would rather run them inside 
rails.  What so you think?  

>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/322c3558-f4fc-4780-baf1-ef3390eddc7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Inttegrating existing rb scripts into rails.

2017-09-01 Thread Ben Edwards
Great, just had a look at this, looks like just the ticket.

So I take it I need to run this from the rails app directory? Where should 
I put the scripts, vendor maybe?  There is at least one class (regarding 
screen scraping) that wont be needed from within ruby, where should I put 
this (currently everything is in a module called scrape so I would put it 
in the ruby app under lib/scrape, or I could have a lib under vendor.  What 
would be best proactive.

On Friday, September 1, 2017 at 5:47:37 PM UTC+1, Hassan Schroeder wrote:
>
> On Fri, Sep 1, 2017 at 9:27 AM, Ben Edwards  > wrote: 
>
> > I have writtern a set of ruby scripts that are used to poulate a 
> database 
> > that I am going to use rails as a front end for users.  Curently they 
> are 
> > stand alone, having there own lib directory and a few classes.  These 
> > scripts are run every night using cron/bash. 
> > 
> > I am planing on changing the database to conform to ActiveRecord so 
> rails 
> > can easily access it but I am wondering if ti is worth moving the 
> scripts 
> > within rails rather than having them stand alone.  If doing this is a 
> good 
> > idea I dont really know where to start.  The key thing is I need to be 
> able 
> > to scedurle tham to run every night. 
>
> Personally I'd recommend having them take advantage of running 
> in the actual Rails environment, and luckily there's an easy way to 
> do exactly that: 
>
>  `rails runner --help` 
>
> should get you started. 
>
> -- 
> Hassan Schroeder  hassan.s...@gmail.com 
>  
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5eb6014c-0deb-4b66-a3f0-bb06f81a18b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Inttegrating existing rb scripts into rails.

2017-09-01 Thread Ben Edwards
Hi, sorry be again;).

I have writtern a set of ruby scripts that are used to poulate a database 
that I am going to use rails as a front end for users.  Curently they are 
stand alone, having there own lib directory and a few classes.  These 
scripts are run every night using cron/bash.

I am planing on changing the database to conform to ActiveRecord so rails 
can easily access it but I am wondering if ti is worth moving the scripts 
within rails rather than having them stand alone.  If doing this is a good 
idea I dont really know where to start.  The key thing is I need to be able 
to scedurle tham to run every night.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/066b2fb8-414b-4248-8a58-c039cb45ddc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Building rails app on existing Postgres Database

2017-09-01 Thread Ben Edwards
Great, so youn dont need to give rails a model file?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/99cb6209-ae83-48f0-a90a-72a474881133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Building rails app on existing Postgres Database

2017-09-01 Thread Ben Edwards
So I basicaly recreate the tables from scratch manualy, using rails to 
create them.  I was worried importing the data may be a bit fiddely if I 
did this (quess I can force rails to use specific data types).  Was hoping 
there was a way rails could help with this.  It may be only a few tables 
but there are quite a few columns.

On Friday, September 1, 2017 at 2:56:35 PM UTC+1, Ben Edwards wrote:
>
> Hi, I have a fairly simple database with a few tables and want to build a 
> rails app on it.  I know I need to do some changes to make it conform to 
> ActiveRecord conventions but when I have done that how do I best access it 
> from rails?  I have found this, 
> https://codeburst.io/how-to-build-a-rails-app-on-top-of-an-existing-database-baa3fe6384a0
>  
> whitch looks usefull (and done a load of googleing) but figured this must 
> be something that people have done before and documenter in a guide/howto.  
> Can someone point me in the wright direction?
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a102680c-2a74-48ff-88fb-226be9e0f3b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Building rails app on existing Postgres Database

2017-09-01 Thread Ben Edwards
Hi, I have a fairly simple database with a few tables and want to build a 
rails app on it.  I know I need to do some changes to make it conform to 
ActiveRecord conventions but when I have done that how do I best access it 
from rails?  I have found this, 
https://codeburst.io/how-to-build-a-rails-app-on-top-of-an-existing-database-baa3fe6384a0
 
whitch looks usefull (and done a load of googleing) but figured this must 
be something that people have done before and documenter in a guide/howto.  
Can someone point me in the wright direction?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/96909e04-ba99-4a55-8479-05ce771b6407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Good version to use in a production enviroment

2017-08-24 Thread Ben Edwards

On Thursday, August 24, 2017 at 3:42:10 AM UTC+1, Phil wrote:
>
>
>  Latest stable is Rails 5.1.3 and Ruby 2.4.1. I'd not try to use older 
> versions... upgrading deprecated stuff in Rails is a PITA, and older Rubys 
> are slower and coming to EOL for security patches anyway.  I'm also on 
> Linux.  Using Apache+Passenger+PostgreSQL to deploy.  You can safely update 
> minor releases as you go as they are released without a lot of pain.  Start 
> with current stable releases and move from there.  
>

So Passenger works with RVM in Apache?

I think I am going with MariaDB (mysql).  Curious why you chose 
PostgreSQL?  
 

> Good luck!  Hope this helps. 
>

Yes a lot. 
Ben



 

>
> Phil 
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/dfd366a3-ab0b-4960-ab6c-f883d2e87655%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Good version to use in a production enviroment

2017-08-24 Thread Ben Edwards


On Wednesday, August 23, 2017 at 4:55:37 PM UTC+1, Ben Edwards wrote:
>
> Hi, we are setting up Ruby on Rails on a production server.  Advice on 
> what version of ROR and Ruby to use would be great.  Obviuiously we want 
> something stable and not too cutting edge.
>
> Also advice on keeping it up to date, especially regarding secularity, 
> would be great.  We have great Linux sys Ops in terms of general security, 
> its the ROR bit of the stack I am asking about.
>
> Regards,
> Ben
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/798cb991-3765-47f1-8bce-b3636b5cda51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Good version to use in a production enviroment

2017-08-23 Thread Ben Edwards
Rolandas,

Thanks for that.  Have setup a master/prod and dev branch/database.  file 
structure is dev/eventtpuddle/ and prod/eventpuddle, with each having 'lib' 
etc in them.  Was thinking of putting a rails directory in each to keep 
everything in the git tree.  Does this make seance.  I guess I need to 
point Apache at a directory under rails but currently have been 
concentrating on writing ruby scripts to populate the database so not 
started using rails yet.  Just want to work out where stuff goes before I 
start.

I can use the dev for staging. 

What is the easiest way of running two versions of ruby & rails, cant 
really go the VM route.

Ben

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7d3722fb-d19d-447b-bdd8-c193c8db5da6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Good version to use in a production enviroment

2017-08-23 Thread Ben Edwards
Hi, we are setting up Ruby on Rails on a production server.  Advice on what 
version of ROR and Ruby to use would be great.  Obviuiously we want 
something stable and not too cutting edge.

Also advice on keeping it up to date, especially regarding secularity, 
would be great.  We have great Linux sys Ops in terms of general security, 
its the ROR bit of the stack I am asking about.

Regards,
Ben

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/4facbb70-988b-4ab9-a50c-16bbaf762dd5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.