Ruby on Rails Wednesday, June 30, 2010

On 30 June 2010 23:45, Neil Bye <lists@ruby-forum.com> wrote:
> Colin Law wrote:
>> On 30 June 2010 20:40, Neil Bye <lists@ruby-forum.com> wrote:
>>>>>
>
>
>> You should not ask the same question twice.
>
> I wouldn't have but the problem was so similar.
>
> So what is the value of
>> @story.id?  You could just display it on the page
>
> It depends which story is shown, that's my problem, it won't pass as a
> parameter or some reason.

Of course it depends which story is shown, it is the id of the
individual story. If the value is nil then no parameter will be
passed, if it is not nil then there should be a parameter. You can
also look at the html of the page (view page source in browser) to
check that the id is there in the href.

Add code to show the id on the page and check that it also appears in the href.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

So switch, and do it quickly!

On Thu, Jul 1, 2010 at 12:40 AM, palani <mpalanikumarit@gmail.com> wrote:
> which one i choose .net or ror
>
> i'm kumar from chennai.now i'm working as a ruby on rails programmer
> (3 months experience).
> now i want to switch my domain to .net(because more no of people told
> me that .net has more no of jobs in mnc 's and as a ror programmer u
> can't get salary like .net )
> pls help me....
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

which one i choose .net or ror

i'm kumar from chennai.now i'm working as a ruby on rails programmer
(3 months experience).
now i want to switch my domain to .net(because more no of people told
me that .net has more no of jobs in mnc 's and as a ror programmer u
can't get salary like .net )
pls help me....

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I just found a gem and put it to work. It's quite good.
http://github.com/flyerhzm/sitemap



On 1 July 2010 15:29, Deepti Tiwari <lists@ruby-forum.com> wrote:
Can anyone help in this ???

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Can anyone help in this ???
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hello how are all

My name is Carlos Zambrano, I'm from Ecuador and I'm doing a graduate thesis about Ruby on Rails vs Php on other frameworks such as Zend, Django and Python on Java or Struts.

I would like you to help me with information about which items should be taken into consideration to make if compared to these other languages vs Ruby because my goal is to demonstrate that this tool is much better than the others.

I've been reading about the language and I've been completely fascinated but still got a lot more to learn, so if you like me to help me because you are more experts on this subject.

Sorry if my English is not very good but I try to do everything possible to make myself understood.

Thanks for your attention



Carlos Zambrano Tandazo
Asistencia Tecnica y Desarrollo de Software
e-mail: carzam27@gmail.com
Telefono: 091150706
Blog: http://krloco78.blogspot.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Consider the following setup:

class Parent < ActiveRecord::Base
has_many :children
end

class Child < ActiveRecord::Base
belongs_to :parent
end

And this console session:

>> p = Parent.find 41
>> p.some_attr = 'some_value'
>> c = p.children.build
>> c.parent

By watching my log files, I can see that c.parent is querying the db
for the parent object. I want instead to access the existing in-memory
object (p), because I need access to the parent's some_attr value,
which is not yet stored in the database. Is there any way of doing
this? c.parent(force_reload=false) doesn't get me there.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Wed, Jun 30, 2010 at 10:12 AM, Joe <joe@dev-hq.co.uk> wrote:
> So, I can't just pass it my permalink value (which is worked out using
> to_param)? I have to create a whole method using regex that returns
> something that is exactly the same?

Why am I starting to feel I'm talking to the wall? :-)

You have URLs, .e.g.

/tutorials/1
/tutorials/3
/tutorials/12

You need a method to extract the unique ID from each of those and
return the permalink value. You don't *have* to use a regex, it's just
a common approach. Write it any way you want. But that is the first
step to solving your problem. Unless you just manually create every
rewrite rule, of course.

> I would GREATLY appreciate it if you could just give a reply like "If
> I had a blog with the same kind of setup, what I could do is write a
> redirect like this, as you can get the permalink value by doing this."

That *would* be an awesome trick, considering that I don't have any
idea where *your* permalink values are coming from. You could be
storing them in the DB, generating them on the fly, scooping them out
of Schrödinger's cat's litter box -- who knows?

Wait -- *you* know, so *you* can write that code.

Though as Marnen previously suggested, many of us *are* available
for contract work :-)

Good luck,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails


On 30 Jun 2010, at 18:13, Mamadou Touré wrote:

Unfortunately I have to hav each file on its own, I must not merge them 
in on single file. Is there a way to simulate several requests in order 
to loop through the array ?

Even if there were, the browser would not be able to understand it.  You 
could use several Ajax requests, but if I were your user, I'd be annoyed 
that your website was randomly downloading files without my consent. 
Why can't you just provide several download links for the files?  Or 
create a zip or tar archive?

So is there another way to merge my xdp file to my pdf without opening 
it in a browser (ie without using the send_file instruction) ? if so, 
this would solve my problem

Find a command line utility for your server OS that will do that for you: http://www.google.be/search?q=command+line+pdf+xdp

Then just run the necessary command line instruction from your Rails app.


Best regards


Peter De Berdt


Ruby on Rails


On 30 Jun 2010, at 16:03, Marnen Laibow-Koser wrote:

Well, fast text searching without switching to MyIsam/Postgres for a 
start.  

Essentially impossible.  You need an index for that.  The way to get a 
full-text index is to switch to MyISAM or, better, Postgres.  Building a 
full-text index in the application layer is poor practice and less 
maintainable.

Moral: let the DB do the indexing.  If your DB doesn't support the 
indexing you need, change your DB -- proper indexing is vital.

... or use a dedicated indexing server like Solr. Depending on the features you want, having an external indexer can even be beneficial to your application. I haven't followed this thread all too much, but you could easily add pluralization to the index record when using something like Solr.


Best regards


Peter De Berdt


Ruby on Rails

Joe wrote:
> So, I can't just pass it my permalink value (which is worked out using
> to_param)? I have to create a whole method using regex that returns
> something that is exactly the same?
>
> Please Help,
>
> I would GREATLY appreciate it if you could just give a reply like "If
> I had a blog with the same kind of setup, what I could do is write a
> redirect like this, as you can get the permalink value by doing this."

You're not going to get this list's populace to write your code for you,
no matter how nicely you ask. If you need someone to write your code,
please support the Rails ecosystem (which has been helping you for free)
and hire a consultant.

>
> Thanks In Advance,
>
> Joe
>
> On 30 June, 02:26, Hassan Schroeder <hassan.schroe...@gmail.com>

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I am trying to port an existing rails app running rails 2.3.8 to
3.0.0beta4

I use this paginate_by_sql hack


module ActiveRecord
class Base
def self.find_by_sql_with_limit(sql, offset, limit)
sql = sanitize_sql(sql)
add_limit!(sql, {:limit => limit, :offset => offset})
find_by_sql(sql)
end

def self.count_by_sql_wrapping_select_query(sql)
sql = sanitize_sql(sql)
count_by_sql("select count(*) from (#{sql}) as x")
end
end
end

The add_limit! method has been removed from ActiveRecord::Base class.
Are there any work arounds for this? Any alternatives to doing
pagination by SQL in Rails 3.0.0?

Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

So, I can't just pass it my permalink value (which is worked out using
to_param)? I have to create a whole method using regex that returns
something that is exactly the same?

Please Help,

I would GREATLY appreciate it if you could just give a reply like "If
I had a blog with the same kind of setup, what I could do is write a
redirect like this, as you can get the permalink value by doing this."

Thanks In Advance,

Joe

On 30 June, 02:26, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Tue, Jun 29, 2010 at 1:37 PM, Joe <j...@dev-hq.co.uk> wrote:
> > I've tried, but I can't figure out how to replace $1 with a permalink
> > variable thats in ruby on rails. Im pretty sure regex cannot help me
> > with this, I need to take the permalink value, and use that in the
> > redirect.
>
> > PLEASE JUST TELL ME AND ILL LEARN, I DONT JUST TAKE THE ANSWER AND BE
> > DONE WITH IT, I LEARN FROM IT.
>
> Top-posting *and* yelling -- not a particularly appealing combination...
>
> But one last try. Your original example:
>
> http://127.0.0.1:3000/categories/1-css/tutorials/12-test9http://127.0.0.1:3000/tutorials/12-test9http://127.0.0.1:3000/categories/1/tutorials/12http://127.0.0.1:3000/tutorials/12
>
> Sure, you can manually enter rewrite rules for *every one* of your
> tutorials and categories, and avoid using regular expressions. Be
> my guest. :-)
>
> Or you can start with the simplest example above, and figure out how
> a simple regex can give you "12" from "/tutorials/12". Write a method
> to take that value "12" and return "12-test9". Put that in a rewrite rule.
> Try it with a couple of other values. Works? Good. Start on the next
> most complex string. Lather, rinse, repeat.
>
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
> twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I'm reposting this here from my original post on Superuser[1], to
hopefully get more relevant feedback from more experienced RoR users.
I need to get a RoR environment up and running, because I have a
client that needs some RoR work done on her website. Although I'm new
to RoR, I'm a quick learner and was expecting installing and setting
up the environment was easy, so I could focus my effort on site
development. I've already spent five days trying to get the
environment up so I could just begin working. I'll probably have
follow up questions to this group (seems I can't get script/server to
work at all) - but for now, this is the immediate concern.

Update #3: Starting over from scratch, shortened this post, decided to
re-install a clean copy of Ubuntu 10.04 on a VM and go through the
walk-through[0] again. So, all the steps go without a hitch. As root:

root@ubuntu:~/rubygems-1.3.7# ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
root@ubuntu:~/rubygems-1.3.7# gem -v
1.3.7
root@ubuntu:~/rubygems-1.3.7# rails -v
Rails 2.3.8
Now, as myself (in a separate term):

emptyset@ubuntu:~$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
emptyset@ubuntu:~$ gem -v
/usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require': no such file
to load -- rubygems/defaults (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
from /usr/local/bin/gem:8:in `require'
from /usr/local/bin/gem:8
emptyset@ubuntu:~$ rails -v
bash: /usr/bin/rails: Permission denied

So, this appears to be a permissions issue, but I don't understand
why. Specifically, if I have to start making things go+rx all over the
place, I really need to understand which specific files need the
permissions change.

Site references:
[0] http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-ubuntu-10-04-lucid-lynx/
[1] http://superuser.com/questions/156498/installing-ruby-on-rails-on-ubuntu-10-04-a-living-nightmare

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Srijith nair wrote:
> Hi David
> This error is mainly because your not getting id in the create function
> Please follow the following steps, i think this will solve your problem.
>
> I hope you configured your routes like this
> map.resources :courses do |course|
> course.resources :pages
> end
>
> <%form_for :page,:url=>course_pages_path(@course) do %>
> <%end%>
>
> in controller
> def new
> @course = Course.find(params[:course_id])
> end
>
> def create
> @course = Course.find(params[:course_id])
> @page = @course.pages.find(params[:page])
> end
>
> Keep rocking!
>
> David Zhu wrote:
>> I'm getting this error-
>>
>> ActiveRecord::RecordNotFound in PagesController#create
>>
>> Couldn't find Course without an ID


I have a very similar problem I think. I Can't find Story without an ID.

This is from my email_controller.rb

def correspond
user = @current_user
story = Story.find(params[:id])
recipient = story.user
@title = "Email @current_user.login"
if param_posted?(:message)
@message = Message.new(params[:message])
if @message.valid?
UserMailer.deliver_message(
:user => user,
:recipient => recipient,
:message => @message,
:user_url => user,
:reply_url => url_for(:action => "correspond",
:id => user.login)
)
flash[:notice] = "Email sent."
redirect_to :action => "index", :controller => "stories"
end
end
end

The problem is in the third line.

Any help would be much appreciated.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi Nin,

> subject, so @Jeremy - I apologise..

No worries at all, you bring up some good points and I welcome anyone
who can offer guidance and newbs who might have questions that I
haven't thought of or are confused about. I am learning this all
myself so I also do not have a mentor or tutor to guide me through the
steps. All I have is books and video tutorials and the ruby and rails
community.

Anyway, the point you brought up about Passenger---
"I mean – it didn't make sense I'd use both Passenger and
Capistrano
(probably it does but I understood they're both used for
deployment,
thus the confusion..), unless Capistrano does both automated
deployment but can also be used when using a different deployment
service.. "

and the response that Marnen supplied---
"They are different tools for different purposes. Capistrano
takes care
of putting your app on the server, while Passenger serves it once
it's
there. "

This was so great because I was still confused about whether to use
Passenger or Capistrano for deployment since I thought they basically
did the same thing. Now that I understand this a little better, it
will definitely help me when learning to use them.

So, thanks for your contributions to the thread :)

@Marnen, and @Hassan--- You ROCK!

Best Regards,
Jeremy

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Marnen Laibow-Koser wrote:
> Mamadou Touré wrote:
> [...]
>>>
>>>
>>>
>>>
>> Thanks Marnen,
>>
>> Unfortunately I have to hav each file on its own, I must not merge them
>> in on single file. Is there a way to simulate several requests in order
>> to loop through the array ?
>
> Even if there were, the browser would not be able to understand it. You
> could use several Ajax requests, but if I were your user, I'd be annoyed
> that your website was randomly downloading files without my consent.
> Why can't you just provide several download links for the files? Or
> create a zip or tar archive?

So is there another way to merge my xdp file to my pdf without opening
it in a browser (ie without using the send_file instruction) ? if so,
this would solve my problem
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

In your first example, is the show action ever called with an id for an
order that doesn't exist? Normally show would never be called with an
invalid id. You say "If you think about it, it'll run the first set of
code when I create a
new object, " but that doesn't make sense to me. It won't run either
set because when you create an object you do it in the create action,
not the show action.

You need to explain more about what your process is here: i don't mean
post tons of code up but explain the sequence of events.

In your second example, what's the actual problem? I would look in your
log to see what params[:logfile] is and then step through your code and
see what it's doing.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Jun 30, 11:34 am, Max Williams <li...@ruby-forum.com> wrote:

> Can you explain in some more detail what you're trying to do here?

Basically taking a file that the user browsed on their local computer
(in this case my own computer since I'm testing it), manipulate the
file directory name and run it through an outside program. The outside
program creates a file that the user can view and I don't want the
ruby code activating again when the user reopens the show page.


> Ok, well then there's a bug in your code: don't give up, try and fix it.
> Post your code up please.

This is the code for my first solution:

In Controller
-------------------
def show
@order = Order.find(params[:id])
respond_to do |format|
if @order then
format.html {redirect_to '/display', :notice => "This task has
already been created"}
format.xml {render :xml => @order}

else
order = @order.logfile
@log_file_cut = order.gsub(/[\w ! # $ % ^ & * + -]+\.log$/,
'*.log')
system('C:\analog_6.0\analog.exe', @log_file_cut)

time = @order.created_at.strftime("%m%d%y_%H%M")
watchforfile = "C:\\rails_project\\test2_copy\\public\\output\
\errors.txt"
File.rename watchforfile, watchforfile+".#{time}.html"

StatusReport.deliver_confirm(@order) #sends email when analog
has completed

format.html {redirect_to(:action => 'edit')} # show.html.erb
format.xml { render :xml => @order }
end
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid task #{params[:id]}")
flash[:notice] = "Invalid task"
redirect_to "/display"
end


If you think about it, it'll run the first set of code when I create a
new object, not the actual ruby code to runs the outside program

> > The other solution I tried was to create an after_filter on the create
> > method. The issue with this was that I couldn't get the parameters
> > from the form and manipulate it.
>
> The code in an after filter can access params.  Post your code up
> please.

My Second Solution In Controller
-----------------------------------------------
after_filter :analog, :only => [:create]


protected
def analog
order = params[:logfile]
@log_file_cut = order.gsub(/[\w ! # $ % ^ & * + -]+\.log$/,
'*.log')
system('C:\analog_6.0\analog.exe', @log_file_cut)
end
end


Thanks for the help :)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I've written a routine for encoding and decoding custom urls.

My route looks like:

map.browse 'items/browse/*query', :controller => 'items', :action =>
'browse'

Now the param query is suposed to look something like:

manufactured_by_Sombody/is_tagged_this_and_that/is_tagged_foo_or_bar/
is_not_tagged_baz_and_nitch

Now I've got the routines built to decode this and turn it into a
thinking sphinx search hash, and I have the code to turn the TS hash
into that url. My problem is, I need access to that code in both the
controller and the view, where is the best place to put this code so
it is accessible in those two locations without repeating the code.

Is there a better way to do this, becaue at the moment in order to
form links I am using code like

link_to "foo", browse_url(:query => parse_browse_url(hash))

I'd appreciate any input.

-Brian

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

@ Hassan: many thanks :)

Was just going to rephrase this question to ask whether Heroku has its
own DNS service or do I need to purchase one and point it to Heroku..
and you just answered me and cleared it up :)

Best,

Nin.

On Jun 30, 6:11 pm, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Wed, Jun 30, 2010 at 7:58 AM, newcomer <newcome...@gmail.com> wrote:
> > Also another question about Heroku -
> > being a host, I was wondering why would it guide me to point my DNS
> > server to Heroku, Zerigo being recommended?
> > Do I need to purchase separately a DNS service when deploying to
> > Heroku?
>
> You have to pick a domain registrar -- Network Solutions, GoDaddy,
> etc. -- to register a domain name. That registrar should offer DNS
> service as part of the registration.
>
> For development and learning purposes, you don't even need that,
> as your heroku deployment will just appear to be a subdomain, e.g.http://example.heroku.com/
>
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
> twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Jun 29, 9:04 am, Andrew Vliet <avl...@vlietwerkz.ca> wrote:>
> Mistake #1:  Oops.  I typed the name of my migration incorrectly, and it
> reverted to...  wait for it...  VERSION="0".

A little late, but another reason 'the rails way' encourages separate
dev and production databases. You will get better performance running
under production mode too

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

anon_comp wrote:
> I've made a scaffold project that has been edited so that when you
> create a new task, the show method will run though some ruby code that
> manipulates the data inputed. I want to make it so that when a user
> types in the url
> http://localhost:3000/some_controller/some_method/some_id_#,
Can you explain in some more detail what you're trying to do here?

> the ruby code won't run again. I tried to fix this problem by telling
> the program to check if the id exsist then don't run the ruby code and
> redirect the user, otherwise run the code. This didn't work becuase
> the id does get created.
Ok, well then there's a bug in your code: don't give up, try and fix it.
Post your code up please.
>
> The other solution I tried was to create an after_filter on the create
> method. The issue with this was that I couldn't get the parameters
> from the form and manipulate it.
The code in an after filter can access params. Post your code up
please.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Wed, Jun 30, 2010 at 3:02 AM, Vuong Hung <lists@ruby-forum.com> wrote:
> I have app RoR good running on NetBean with JRuby
> But, I upload up server to server, it not run.

<http://catb.org/~esr/faqs/smart-questions.html>

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I use Filezilla (sudo apt-get install filezilla). Supports ftp,sftp, etc

On 29 June 2010 22:23, Ali Imran <ali.imran.rana@gmail.com> wrote:
I am trying to upload the constants to my shared server but built in
FTP in Ubuntu is not working

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I've made a scaffold project that has been edited so that when you
create a new task, the show method will run though some ruby code that
manipulates the data inputed. I want to make it so that when a user
types in the url http://localhost:3000/some_controller/some_method/some_id_#,
the ruby code won't run again. I tried to fix this problem by telling
the program to check if the id exsist then don't run the ruby code and
redirect the user, otherwise run the code. This didn't work becuase
the id does get created.

The other solution I tried was to create an after_filter on the create
method. The issue with this was that I couldn't get the parameters
from the form and manipulate it.

I appreciate all the help I can get!

Thanks,
Anon_comp

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Wed, Jun 30, 2010 at 7:58 AM, newcomer <newcomerme@gmail.com> wrote:

> Also another question about Heroku -
> being a host, I was wondering why would it guide me to point my DNS
> server to Heroku, Zerigo being recommended?
> Do I need to purchase separately a DNS service when deploying to
> Heroku?

You have to pick a domain registrar -- Network Solutions, GoDaddy,
etc. -- to register a domain name. That registrar should offer DNS
service as part of the registration.

For development and learning purposes, you don't even need that,
as your heroku deployment will just appear to be a subdomain, e.g.
http://example.heroku.com/

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Turns out the Prawn gem cannot handle existing files...
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Jun 30, 5:45 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> newcomer wrote:
> > @Marnen: Thank you! I appreciate it a lot..
>
> > The joy I feel after reading your reply, when things start to make
> > sense.. this is great, thanks :)
>
> > wrote below..
>
> > On Jun 30, 4:08 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> >> newcomer wrote:
>
> >> > started developing) might not be a good idea at all.
> >> problem.
>
> > This one surprised me a bit as I heard many confident "no-no"s on
> > this, though what you wrote sounds like good news. Naturally, best
> > thing would be to try it out, just hesitated because of what I've
> > heard on this subject.. (and besides, was also thrilled to get into
> > Linux as well, though learning everything from scratch at the same
> > time has it's pros and cons..)
>
> Er, I was talking about Mint Linux vs. Ubuntu Linux (which shouldn't be
> a problem), not Windows vs. *nix (which might well cause problems).
>
>

Funny, just sent another question about that :)
Got it, thanks.. will happily move to VM then..

>
> > I did have another reason to go and install VM, though I'm not sure it
> > was a correct one, short description as follows:
>
> > In one of the posts around I read about Cappuccino and it looked
> > great, so wanted to try it out as well for my User Interface.. but the
> > download instructions contain a shell script I'm supposed to be
> > running (if I understood correctly), when not building from the source
> > (being a Newbie and after reading a bit I assumed this was not for me
> > yet).
> > Anyway, when happily going to Cygwin to run the bootstrap.sh file I
> > encountered the following message:
>
> > "Error: Narwhal is not compatible with your JVM. Please switch to the
> > Sun (HotSpot) JVM and re-run bootstrap.sh"
>
> [...]
>
> This is probably better directed to a Cappuccino forum.

yes, my embarrassment in sending stupid questions (like in this post)
prevented me from asking them thus receiving answers.
But after your replies I feel more confident to ask these :)

Best,

Nin.

>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi :)

confused again:
My first question here is a bit less connected to the original post's
subject, so @Jeremy - I apologise..

@Marnen: Just read this again:
http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/55bdcc2ee8fb0c3e/72613f954c70a9f2?#72613f954c70a9f2

After reading your reply, I thought I should give it a try to
Passenger, but according to this I should be using VM while I just
understood from the previous answer I do not have to (as I wrote
before, will move to VM gladly, but just trying to understand first)

Also another question about Heroku -
being a host, I was wondering why would it guide me to point my DNS
server to Heroku, Zerigo being recommended?
Do I need to purchase separately a DNS service when deploying to
Heroku?
Or is it again my lack of understading of an additional functionality?

(was looking on this page here:
http://docs.heroku.com/custom-domains#dns-setup
)


Thanks again :)


Best,
Nin.

On Jun 30, 4:08 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> newcomer wrote:
> > Hi Jeremy and everyone :)
>
> > Found myself following this discussion and all the great informative
> > answers supplied here. I am too in a learning process with my first
> > app, very much a Newbie (in RoR and Web in general, though have a
> > programming experience) and lately have been trying to figure out the
> > deployment process, terms, and sort of 'what belongs where' :)
>
> Welcome!
>
> [...]
>
> > I'm currently developing on Windows..  started with using InstantRails
> > and installed Git on Cygwin. This allowed me to experiment with some
> > developing locally, begin with local version control and git-clone
> > repositories for plugins/Gems.
> > As I read some more, I realized I'd probably want to deploy my App on
> > a Linux/Unix based server rather than a Windows one and that
> > developing on windows and deploying on Linux (the way I initially
> > started developing) might not be a good idea at all.
> > Therefore I decided to install VM on my Windows machine.. have seen
> > some posts lately on the subject.. currently I just installed VMWare
> > Player (had to use version 2.5, my CPU wasn t compatible with 3.1) but
> > have thoughts of maybe trying VirtualRails instead (if it works on my
> > machine) I did see VirtualRails is using MintLinux-based Linux and
> > was wondering whether that might cause future problems (as opposed to
> > using Ubuntu for example)?
>
> I doubt that that would be a problem.  I develop on Mac OS X (which is
> BSD, not Linux) and routinely deploy to Linux servers without any
> problem.
>
> [...]
>
> > Ok deployment questions:
> > I couldn't understand for sure whether I need both a host and a place
> > to deploy my App?
>
> No.  A host is a place to deploy your app.  Same thing.
>
> [...]
>
> > I mean it didn't make sense I'd use both Passenger and Capistrano
> > (probably it does but I understood they're both used for deployment,
> > thus the confusion..), unless Capistrano does both automated
> > deployment but can also be used when using a different deployment
> > service..
>
> They are different tools for different purposes.  Capistrano takes care
> of putting your app on the server, while Passenger serves it once it's
> there.
>
> > I feel and know I mix everything up here, but any light you can put
> > for me on this subject will be very helpful..
> > Was also confused by the fact Phusion Passenger offers "Phusion
> > Passenger for Nginx".. while I got the impression (obviously a wrong
> > one, or not full) I can deploy my app on Nginx as well?
> > At least I heard people mentioning Nginx at the same sentence with
> > Heroku and Passenger..
>
> Apache and Nginx are Web server programs.  By themselves, they just
> serve static files without any server-side dynamic content.  This is
> great for serving static websites, but obviously will not work if you're
> using a server-side programming language like PHP or Ruby.  For Apache
> or Nginx to run PHP/Ruby/Python/whatever applications, it needs a module
> to connect it to the appropriate interpreter.  That's basically what
> Passenger does.
>
> In other words, you need Passenger (or something similar, but Passenger
> is probably simplest) in order for Apache or Nginx to talk to the Ruby
> interpreter.  Passenger is available either as an Apache module or as an
> Nginx module.
>
> > This brings me to another question:
> > I also understood I can use heroku for deployment, which will require
> > not more than one git push every once in a while (of course I know
> > there's much more to it, but it was to explain me the ease of use)..
> > in case I do use heroku (couldn't find any cons to using it I should
> > be aware of, if someone can write a few from his/her experience, I'll
> > be glad to learn..) can I git push from my local repository or do I
> > need first to push to a remote one, such as a public/private
> > repository on GitHub?
>
> You can git push from anywhere.  Heroku doesn't care.
>
> > Moreover, if I'm the only one playing around
> > with this app right now what benefits can a GitHub repository give
> > me comparing to using it locally?
>
> It gives you another copy of the code stored offsite.
>
> [...]
>
> > More about Heroku if I choose to use it, do I need a host as well?
>
> Heroku *is* a host.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Ar Chron wrote:
> If you haven't cleared out your log along the way, you should be able to
> parse through that and reconstruct your inserts.
>
> I know I periodically 'archive off' my development.log
> (development.log.thru.20100617 anyone?) just so I have a record
> (especially when trying to diagnose issues).

Hmm. Perhaps instead of doing that, you should just put your
development.log in version control? (I confess that I've never needed
an archive such as you describe.)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

newcomer wrote:
> @Marnen: Thank you! I appreciate it a lot..
>
> The joy I feel after reading your reply, when things start to make
> sense.. this is great, thanks :)
>
> wrote below..
>
>
> On Jun 30, 4:08 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
>> newcomer wrote:
>
>> > started developing) might not be a good idea at all.
>> problem.
>>
>
> This one surprised me a bit as I heard many confident "no-no"s on
> this, though what you wrote sounds like good news. Naturally, best
> thing would be to try it out, just hesitated because of what I've
> heard on this subject.. (and besides, was also thrilled to get into
> Linux as well, though learning everything from scratch at the same
> time has it's pros and cons..)

Er, I was talking about Mint Linux vs. Ubuntu Linux (which shouldn't be
a problem), not Windows vs. *nix (which might well cause problems).

>
> I did have another reason to go and install VM, though I'm not sure it
> was a correct one, short description as follows:
>
> In one of the posts around I read about Cappuccino and it looked
> great, so wanted to try it out as well for my User Interface.. but the
> download instructions contain a shell script I'm supposed to be
> running (if I understood correctly), when not building from the source
> (being a Newbie and after reading a bit I assumed this was not for me
> yet).
> Anyway, when happily going to Cygwin to run the bootstrap.sh file I
> encountered the following message:
>
> "Error: Narwhal is not compatible with your JVM. Please switch to the
> Sun (HotSpot) JVM and re-run bootstrap.sh"
[...]

This is probably better directed to a Cappuccino forum.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Did you check mysql config on server?

On Jun 30, 5:12 am, fischer1121 <bfischer1...@gmail.com> wrote:
> Hi all,
>
> I am getting the following error in the middle of a long-running
> process: "Mysql::Error: Lost connection to MySQL server during
> query:..."
> When rescued and retried, it throws the next error: "Mysql::Error:
> MySQL server has gone away"
>
> (1) The query is not long and (2) the process does not last longer
> than 8 hours (it's < 15 minutes) or idle for a long period.
>
> I've tried: ActiveRecord::Base.allow_concurrency = true,
> ActiveRecord::Base.verification_timeout = 10, and
> ActiveRecord::Base.verify_active_connections!
>
> I can use (1) ActiveRecord::Base.connection_pool.with_connection or
> (2) ActiveRecord::Base.verify_active_connections! to fix it, but...
>
> when future queries search for data that was inserted previously in
> the process, it is no longer there. It seems like there's something
> wrapped around everything - tied to the connection - that prevents any
> writes from really persisting to the database until, I'm assuming, the
> process is complete.
>
> How do I fix the lost MySQL connections or at least make writes
> persist to the database mid-process so that when I open a new
> connection the records will be there?
>
> Any help is appreciated.
>
> Thanks,
>
> Blake

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

@Marnen: Thank you! I appreciate it a lot..

The joy I feel after reading your reply, when things start to make
sense.. this is great, thanks :)

wrote below..


On Jun 30, 4:08 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> newcomer wrote:

>
> [...]
>
> > I'm currently developing on Windows.. started with using InstantRails
> > and installed Git on Cygwin. This allowed me to experiment with some
> > developing locally, begin with local version control and git-clone
> > repositories for plugins/Gems.
> > As I read some more, I realized I'd probably want to deploy my App on
> > a Linux/Unix based server rather than a Windows one and that
> > developing on windows and deploying on Linux (the way I initially
> > started developing) might not be a good idea at all.
> > Therefore I decided to install VM on my Windows machine.. have seen
> > some posts lately on the subject.. currently I just installed VMWare
> > Player (had to use version 2.5, my CPU wasn t compatible with 3.1) but
> > have thoughts of maybe trying VirtualRails instead (if it works on my
> > machine) I did see VirtualRails is using MintLinux-based Linux and
> > was wondering whether that might cause future problems (as opposed to
> > using Ubuntu for example)?
>
> I doubt that that would be a problem. I develop on Mac OS X (which is
> BSD, not Linux) and routinely deploy to Linux servers without any
> problem.
>

This one surprised me a bit as I heard many confident "no-no"s on
this, though what you wrote sounds like good news. Naturally, best
thing would be to try it out, just hesitated because of what I've
heard on this subject.. (and besides, was also thrilled to get into
Linux as well, though learning everything from scratch at the same
time has it's pros and cons..)

I did have another reason to go and install VM, though I'm not sure it
was a correct one, short description as follows:

In one of the posts around I read about Cappuccino and it looked
great, so wanted to try it out as well for my User Interface.. but the
download instructions contain a shell script I'm supposed to be
running (if I understood correctly), when not building from the source
(being a Newbie and after reading a bit I assumed this was not for me
yet).
Anyway, when happily going to Cygwin to run the bootstrap.sh file I
encountered the following message:

"Error: Narwhal is not compatible with your JVM. Please switch to the
Sun (HotSpot) JVM and re-run bootstrap.sh"

and from reading a bit
(like here:
http://groups.google.com/group/objectivej/browse_frm/thread/c4996786d8465be7/72d2fcdcfdf7ccb7?tvc=1#72d2fcdcfdf7ccb7
)

I understood (though haven't asked directly and I may be wrong here)
VM won't encounter such problems.. it's Cygwin that's not supported

But.. now that I'm writing it here, I re-think this and actually don't
know if that's a required thing for my needs of Cappuccino or even if
I understood correctly.. (sigh..)

> [...]

After this re-thinking and sighing, I still am very happy about the
information you supplied me with..

Thanks again :)

Nin.

On Jun 30, 4:08 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> newcomer wrote:
> > Hi Jeremy and everyone :)
>
> > Found myself following this discussion and all the great informative
> > answers supplied here. I am too in a learning process with my first
> > app, very much a Newbie (in RoR and Web in general, though have a
> > programming experience) and lately have been trying to figure out the
> > deployment process, terms, and sort of 'what belongs where' :)
>
> Welcome!
>
> [...]
>
> > I'm currently developing on Windows..  started with using InstantRails
> > and installed Git on Cygwin. This allowed me to experiment with some
> > developing locally, begin with local version control and git-clone
> > repositories for plugins/Gems.
> > As I read some more, I realized I'd probably want to deploy my App on
> > a Linux/Unix based server rather than a Windows one and that
> > developing on windows and deploying on Linux (the way I initially
> > started developing) might not be a good idea at all.
> > Therefore I decided to install VM on my Windows machine.. have seen
> > some posts lately on the subject.. currently I just installed VMWare
> > Player (had to use version 2.5, my CPU wasn t compatible with 3.1) but
> > have thoughts of maybe trying VirtualRails instead (if it works on my
> > machine) I did see VirtualRails is using MintLinux-based Linux and
> > was wondering whether that might cause future problems (as opposed to
> > using Ubuntu for example)?
>
> I doubt that that would be a problem.  I develop on Mac OS X (which is
> BSD, not Linux) and routinely deploy to Linux servers without any
> problem.
>
> [...]
>
> > Ok deployment questions:
> > I couldn't understand for sure whether I need both a host and a place
> > to deploy my App?
>
> No.  A host is a place to deploy your app.  Same thing.
>
> [...]
>
> > I mean it didn't make sense I'd use both Passenger and Capistrano
> > (probably it does but I understood they're both used for deployment,
> > thus the confusion..), unless Capistrano does both automated
> > deployment but can also be used when using a different deployment
> > service..
>
> They are different tools for different purposes.  Capistrano takes care
> of putting your app on the server, while Passenger serves it once it's
> there.
>
> > I feel and know I mix everything up here, but any light you can put
> > for me on this subject will be very helpful..
> > Was also confused by the fact Phusion Passenger offers "Phusion
> > Passenger for Nginx".. while I got the impression (obviously a wrong
> > one, or not full) I can deploy my app on Nginx as well?
> > At least I heard people mentioning Nginx at the same sentence with
> > Heroku and Passenger..
>
> Apache and Nginx are Web server programs.  By themselves, they just
> serve static files without any server-side dynamic content.  This is
> great for serving static websites, but obviously will not work if you're
> using a server-side programming language like PHP or Ruby.  For Apache
> or Nginx to run PHP/Ruby/Python/whatever applications, it needs a module
> to connect it to the appropriate interpreter.  That's basically what
> Passenger does.
>
> In other words, you need Passenger (or something similar, but Passenger
> is probably simplest) in order for Apache or Nginx to talk to the Ruby
> interpreter.  Passenger is available either as an Apache module or as an
> Nginx module.
>
> > This brings me to another question:
> > I also understood I can use heroku for deployment, which will require
> > not more than one git push every once in a while (of course I know
> > there's much more to it, but it was to explain me the ease of use)..
> > in case I do use heroku (couldn't find any cons to using it I should
> > be aware of, if someone can write a few from his/her experience, I'll
> > be glad to learn..) can I git push from my local repository or do I
> > need first to push to a remote one, such as a public/private
> > repository on GitHub?
>
> You can git push from anywhere.  Heroku doesn't care.
>
> > Moreover, if I'm the only one playing around
> > with this app right now what benefits can a GitHub repository give
> > me comparing to using it locally?
>
> It gives you another copy of the code stored offsite.
>
> [...]
>
> > More about Heroku if I choose to use it, do I need a host as well?
>
> Heroku *is* a host.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks buddy, it is working.

On Jun 29, 11:33 am, Lake Denman <lden...@gmail.com> wrote:
> Well, it looks like you're using rails 2.2.3 in your config/
> environment.rb file.
>
> You can either update that version number in the environment.rb file
> to match 2.3.8, the rails version you say you have installed on your
> host, and deploy.
>
> Or "gem install -v=2.2.3 rails" on your server and hope for the
> best. :)
>
> good luck,
>
> Lake
>
> On Jun 29, 12:43 am, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
> > I follow all the steps and got this error
>
> > The application has exited during startup (i.e. during the evaluation
> > of config/environment.rb). The error message can be found below. To
> > solve this problem, please follow any instructions in the error
> > message.
> > Error message:
> > Missing the Rails 2.2.3 gem. Please `gem install -v=2.2.3 rails`,
> > update your RAILS_GEM_VERSION setting in config/environment.rb for the
> > Rails version you do have installed, or comment out RAILS_GEM_VERSION
> > to use the latest version installed.
> > Application root:
> > /home/realhotr/demo
>
> > On Jun 28, 8:36 pm, Victor S <victor.s...@gmail.com> wrote:
>
> > > If you go to google. you can type: "site5 rails deploy" and the first
> > > hit you get is the answer...
>
> > > Did you try to do what that post sais? Also try to be perceptive of
> > > any minute differences in your environment or how you might like to
> > > make things work for you better... you don't have or if the info is a
> > > bit outdate, be following things strictly, try to adapt the tutorial
> > > to what you need. Let me know if the tutorial doesn't do it for you
> > > still.
>
> > > - V
>
> > > On Jun 28, 4:34 pm, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
> > > > thanks for the reply.
>
> > > > I read the completely link you send me. and i also looked at the
> > > > site5.com forum and still looking at it but did not find any help to
> > > > deploy the application . I tried all the ways i know...
>
> > > > On Jun 27, 11:33 pm, Victor S <victor.s...@gmail.com> wrote:
>
> > > > > I deployed on Site5, so it's possible :)
>
> > > > > Search their bulletin board for a tutorial, i can't remember the link
> > > > > off hand, if you have trouble let me know.
>
> > > > > If you are developing locally you don't need apache, just go to your
> > > > > app in the terminal and say$ script/server
>
> > > > > This is a pretty good getting started guide:http://guides.rubyonrails.org/getting_started.html
>
> > > > > But anyway... check the Site5 forum it worked for me, you can try
> > > > > using the cpanel to start off your rails app, and it will setup a
> > > > > subdomain for you. if your get that app working, replace the contents
> > > > > of the folder with your own...
>
> > > > > I ssh'ed into site5 and linked the folder created by the cpanel wizard
> > > > > to my own rails 'public' folder outside the www folder, if i remember
> > > > > correctly. Theres no need for your rails app to be available to
> > > > > apache. Then you probably want to look into theirpassengerserver
> > > > > restart method... where you're supposed to make a file called
> > > > > restart.txt or something, and put it somewhere, I can't remember
> > > > > exactly I think I moved it from the default location... again, the
> > > > > forums are a good resource :) -- then you just ssh again and unix
> > > > > "touch" it and bam the server restarts.... you might not want this
> > > > > file to be in the www folder either ;)
>
> > > > > Good luck,
>
> > > > > - V
>
> > > > > On Jun 26, 11:28 pm, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
> > > > > > I install locally apache2..
> > > > > > and i have two hosting accounts i can use any one ...
>
> > > > > > i have one with site5.com and other one is godaddy.com...
>
> > > > > > what step i need to take now please help me ... its driving me crazy..
>
> > > > > > On Jun 26, 12:02 pm, murali dhararao <sumud...@gmail.com> wrote:
>
> > > > > > > Hi ,
>
> > > > > > > Did you deployed application on apache server? is that is running locally?
>
> > > > > > > On Sat, Jun 26, 2010 at 3:37 AM, Ali Imran <ali.imran.r...@gmail.com> wrote:
> > > > > > > > I installed
>
> > > > > > > > ruby: 1.8.7
> > > > > > > > rails: 2.3.8
> > > > > > > > gems:  1.3.5
>
> > > > > > > > on the Ubuntu withpassenger 2.2.15
>
> > > > > > > > now i create the first demo application,
>
> > > > > > > > i create a folder on home "ruby"->"demo"
>
> > > > > > > > than i created a sites-available
>
> > > > > > > > udo nano /etc/apache2/sites-available/demo
>
> > > > > > > > <VirtualHost *:80>
>
> > > > > > > > ServerName mydomain.com
> > > > > > > > ServerAliaswww.mydomain.com
>
> > > > > > > > DocumentRoot /home/ruby/demo/public
>
> > > > > > > > </VirtualHost>
>
> > > > > > > > i am looking for next step .. where to go from here and also please
> > > > > > > > help me if i am doing these steps wrong
>
> > > > > > > > i also run the demo project by apache2 server by
>
> > > > > > > > placing application in  /var/www
>
> > > > > > > > and it works fine.
>
> > > > > > > > but how i move to this my shared hosting server
> > > > > > > > and run online
>
> > > > > > > > Thanks
>
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the Google Groups
> > > > > > > > "Ruby on Rails: Talk" group.
> > > > > > > > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscrib e@googlegroups.com>
> > > > > > > > .
> > > > > > > > For more options, visit this group at
> > > > > > > >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > > > > > > --
> > > > > > > Thanks & Regards,
> > > > > > > MuraliDharaRao.T
> > > > > > > +91-9642234646

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Jesse Crockett wrote:
> Award.all(:joins => "INNER JOIN overall_rankings ON
> (overall_rankings.poem_id = awards.poem_id)") gets the wrong
> award.overall_ranking on heroku postgres
>
> Poem
> has_many :awards
> has_one :overall_ranking
>
> Award
> belongs_to :poem
> has_one :overall_ranking, :foreign_key => :poem_id
>
> OverallRanking
> belongs_to :poem

# Solution

Award
has_one :overall_ranking, :foreign_key => :poem_id, :primary_key =>
:poem_id

Award.all(:include => :overall_ranking)
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

[Please quote when replying, so that the discussion is easier to
follow.]

Max Williams wrote:
> Well, fast text searching without switching to MyIsam/Postgres for a
> start.

Essentially impossible. You need an index for that. The way to get a
full-text index is to switch to MyISAM or, better, Postgres. Building a
full-text index in the application layer is poor practice and less
maintainable.

Moral: let the DB do the indexing. If your DB doesn't support the
indexing you need, change your DB -- proper indexing is vital.

But also the ability to automatically deal with pluralisation
> and (probably at some point) fuzzy matching. Definitely the
> pluralisation at least, anyway.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Well, fast text searching without switching to MyIsam/Postgres for a
start. But also the ability to automatically deal with pluralisation
and (probably at some point) fuzzy matching. Definitely the
pluralisation at least, anyway.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks,

I was looking at the guides, but didn't know exactly what version it
was updated for...

thanks for the rails3 beta link!

On Jun 28, 10:28 am, Fernando Brito <em...@fernandobrito.com> wrote:
> I also like this one:http://railsapi.com/doc/rails-v3.0.0.beta.3/
> Please note that we are in beta4.
>
> There is also the "Ruby on Rails Guides" updated.http://guides.rails.info/

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Neil Bye wrote:
>> The email is to be sent from a page containing a story and comments. I
>> want it to go to @story.user's email. If I use story=
>> Story.find_by_id(2) it works but I want an expression to find the
>> current story not one specified.
>> Does that tell you enough? Do you want more files sent?

I assume you have a show page that contains the story and the comments.

How are you triggering the email from that form? A hyperlink I assume?
If that's the case, just pass the current story id as a parameter on the
link_to, which makes that id available in the controller for your
Story.find(params[:id]) or something close to that.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Love the Ryan Bates railscasts... work of genius.

On Jun 29, 1:19 pm, geolev <geo...@gmail.com> wrote:
> Ryan Bates did a Railscast on this yesterday.
>
> http://railscasts.com/episodes/220-pdfkit
>
> On Jun 18, 4:23 pm, Rails Learner <li...@ruby-forum.com> wrote:
>
>
>
> > Hi Everybody,
>
> > Can anyone give me a small working example of how to use PDFKIT to
> > convert a view in rails app to pdf file?
>
> > Any help is much appreciated!
>
> > Thanks!
> > --
> > Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

newcomer wrote:
> Hi Jeremy and everyone :)
>
> Found myself following this discussion and all the great informative
> answers supplied here. I am too in a learning process with my first
> app, very much a Newbie (in RoR and Web in general, though have a
> programming experience) and lately have been trying to figure out the
> deployment process, terms, and sort of 'what belongs where' :)

Welcome!


[...]
> I'm currently developing on Windows.. started with using InstantRails
> and installed Git on Cygwin. This allowed me to experiment with some
> developing locally, begin with local version control and git-clone
> repositories for plugins/Gems.
> As I read some more, I realized I'd probably want to deploy my App on
> a Linux/Unix based server rather than a Windows one and that
> developing on windows and deploying on Linux (the way I initially
> started developing) might not be a good idea at all.
> Therefore I decided to install VM on my Windows machine.. have seen
> some posts lately on the subject.. currently I just installed VMWare
> Player (had to use version 2.5, my CPU wasn�t compatible with 3.1) but
> have thoughts of maybe trying VirtualRails instead (if it works on my
> machine) � I did see VirtualRails is using MintLinux-based Linux and
> was wondering whether that might cause future problems (as opposed to
> using Ubuntu for example)?

I doubt that that would be a problem. I develop on Mac OS X (which is
BSD, not Linux) and routinely deploy to Linux servers without any
problem.

[...]
> Ok � deployment questions:
> I couldn't understand for sure whether I need both a host and a place
> to deploy my App?

No. A host is a place to deploy your app. Same thing.

[...]
> I mean � it didn't make sense I'd use both Passenger and Capistrano
> (probably it does but I understood they're both used for deployment,
> thus the confusion..), unless Capistrano does both automated
> deployment but can also be used when using a different deployment
> service..

They are different tools for different purposes. Capistrano takes care
of putting your app on the server, while Passenger serves it once it's
there.

> I feel and know I mix everything up here, but any light you can put
> for me on this subject will be very helpful..
> Was also confused by the fact Phusion Passenger offers "Phusion
> Passenger for Nginx".. while I got the impression (obviously a wrong
> one, or not full) � I can deploy my app on Nginx as well?
> At least I heard people mentioning Nginx at the same sentence with
> Heroku and Passenger..

Apache and Nginx are Web server programs. By themselves, they just
serve static files without any server-side dynamic content. This is
great for serving static websites, but obviously will not work if you're
using a server-side programming language like PHP or Ruby. For Apache
or Nginx to run PHP/Ruby/Python/whatever applications, it needs a module
to connect it to the appropriate interpreter. That's basically what
Passenger does.

In other words, you need Passenger (or something similar, but Passenger
is probably simplest) in order for Apache or Nginx to talk to the Ruby
interpreter. Passenger is available either as an Apache module or as an
Nginx module.

> This brings me to another question:
> I also understood I can use heroku for deployment, which will require
> not more than one git push every once in a while (of course I know
> there's much more to it, but it was to explain me the ease of use)..
> in case I do use heroku (couldn't find any cons to using it I should
> be aware of, if someone can write a few from his/her experience, I'll
> be glad to learn..) � can I git push from my local repository or do I
> need first to push to a remote one, such as a public/private
> repository on GitHub?

You can git push from anywhere. Heroku doesn't care.

> Moreover, if I'm the only one playing around
> with this app right now � what benefits can a GitHub repository give
> me comparing to using it locally?

It gives you another copy of the code stored offsite.

[...]
> More about Heroku � if I choose to use it, do I need a host as well?

Heroku *is* a host.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Yes :) the error message tells you exactly what you have to do, just
like Lake did.

On Jun 29, 1:33 pm, Lake Denman <lden...@gmail.com> wrote:
> Well, it looks like you're using rails 2.2.3 in your config/
> environment.rb file.
>
> You can either update that version number in the environment.rb file
> to match 2.3.8, the rails version you say you have installed on your
> host, and deploy.
>
> Or "gem install -v=2.2.3 rails" on your server and hope for the
> best. :)
>
> good luck,
>
> Lake
>
> On Jun 29, 12:43 am, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
>
>
> > I follow all the steps and got this error
>
> > The application has exited during startup (i.e. during the evaluation
> > of config/environment.rb). The error message can be found below. To
> > solve this problem, please follow any instructions in the error
> > message.
> > Error message:
> > Missing the Rails 2.2.3 gem. Please `gem install -v=2.2.3 rails`,
> > update your RAILS_GEM_VERSION setting in config/environment.rb for the
> > Rails version you do have installed, or comment out RAILS_GEM_VERSION
> > to use the latest version installed.
> > Application root:
> > /home/realhotr/demo
>
> > On Jun 28, 8:36 pm, Victor S <victor.s...@gmail.com> wrote:
>
> > > If you go to google. you can type: "site5 rails deploy" and the first
> > > hit you get is the answer...
>
> > > Did you try to do what that post sais? Also try to be perceptive of
> > > any minute differences in your environment or how you might like to
> > > make things work for you better... you don't have or if the info is a
> > > bit outdate, be following things strictly, try to adapt the tutorial
> > > to what you need. Let me know if the tutorial doesn't do it for you
> > > still.
>
> > > - V
>
> > > On Jun 28, 4:34 pm, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
> > > > thanks for the reply.
>
> > > > I read the completely link you send me. and i also looked at the
> > > > site5.com forum and still looking at it but did not find any help to
> > > > deploy the application . I tried all the ways i know...
>
> > > > On Jun 27, 11:33 pm, Victor S <victor.s...@gmail.com> wrote:
>
> > > > > I deployed on Site5, so it's possible :)
>
> > > > > Search their bulletin board for a tutorial, i can't remember the link
> > > > > off hand, if you have trouble let me know.
>
> > > > > If you are developing locally you don't need apache, just go to your
> > > > > app in the terminal and say$ script/server
>
> > > > > This is a pretty good getting started guide:http://guides.rubyonrails.org/getting_started.html
>
> > > > > But anyway... check the Site5 forum it worked for me, you can try
> > > > > using the cpanel to start off your rails app, and it will setup a
> > > > > subdomain for you. if your get that app working, replace the contents
> > > > > of the folder with your own...
>
> > > > > I ssh'ed into site5 and linked the folder created by the cpanel wizard
> > > > > to my own rails 'public' folder outside the www folder, if i remember
> > > > > correctly. Theres no need for your rails app to be available to
> > > > > apache. Then you probably want to look into theirpassengerserver
> > > > > restart method... where you're supposed to make a file called
> > > > > restart.txt or something, and put it somewhere, I can't remember
> > > > > exactly I think I moved it from the default location... again, the
> > > > > forums are a good resource :) -- then you just ssh again and unix
> > > > > "touch" it and bam the server restarts.... you might not want this
> > > > > file to be in the www folder either ;)
>
> > > > > Good luck,
>
> > > > > - V
>
> > > > > On Jun 26, 11:28 pm, Ali Imran <ali.imran.r...@gmail.com> wrote:
>
> > > > > > I install locally apache2..
> > > > > > and i have two hosting accounts i can use any one ...
>
> > > > > > i have one with site5.com and other one is godaddy.com...
>
> > > > > > what step i need to take now please help me ... its driving me crazy..
>
> > > > > > On Jun 26, 12:02 pm, murali dhararao <sumud...@gmail.com> wrote:
>
> > > > > > > Hi ,
>
> > > > > > > Did you deployed application on apache server? is that is running locally?
>
> > > > > > > On Sat, Jun 26, 2010 at 3:37 AM, Ali Imran <ali.imran.r...@gmail.com> wrote:
> > > > > > > > I installed
>
> > > > > > > > ruby: 1.8.7
> > > > > > > > rails: 2.3.8
> > > > > > > > gems:  1.3.5
>
> > > > > > > > on the Ubuntu withpassenger 2.2.15
>
> > > > > > > > now i create the first demo application,
>
> > > > > > > > i create a folder on home "ruby"->"demo"
>
> > > > > > > > than i created a sites-available
>
> > > > > > > > udo nano /etc/apache2/sites-available/demo
>
> > > > > > > > <VirtualHost *:80>
>
> > > > > > > > ServerName mydomain.com
> > > > > > > > ServerAliaswww.mydomain.com
>
> > > > > > > > DocumentRoot /home/ruby/demo/public
>
> > > > > > > > </VirtualHost>
>
> > > > > > > > i am looking for next step .. where to go from here and also please
> > > > > > > > help me if i am doing these steps wrong
>
> > > > > > > > i also run the demo project by apache2 server by
>
> > > > > > > > placing application in  /var/www
>
> > > > > > > > and it works fine.
>
> > > > > > > > but how i move to this my shared hosting server
> > > > > > > > and run online
>
> > > > > > > > Thanks
>
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the Google Groups
> > > > > > > > "Ruby on Rails: Talk" group.
> > > > > > > > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscrib e@googlegroups.com>
> > > > > > > > .
> > > > > > > > For more options, visit this group at
> > > > > > > >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > > > > > > --
> > > > > > > Thanks & Regards,
> > > > > > > MuraliDharaRao.T
> > > > > > > +91-9642234646

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.