Where put require

Where do I put e g require 'will_paginate' in Rails 3 environment?

Where do I put e g require ‘will_paginate’ in Rails 3 environment?

Are you using the gem? If the gem, just include it in the gemfile and you should be good:

gem ‘will_paginate’, :git => ‘git://github.com/mislav/will_paginate.git’, :branch => ‘rails3’

David Kahn wrote in post #969813:

On Tue, Dec 21, 2010 at 9:51 AM, Paul Bergstrom

Are you using the gem? If the gem, just include it in the gemfile and you should be good:

gem 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git', :branch => 'rails3'

Even if it's already installed?

David Kahn wrote in post #969813:

On Tue, Dec 21, 2010 at 9:51 AM, Paul Bergstrom

Are you using the gem? If the gem, just include it in the gemfile and

you

should be good:

gem ‘will_paginate’, :git =>

‘git://github.com/mislav/will_paginate.git’,

:branch => ‘rails3’

Even if it’s already installed?

Right… you want all your dependencies in the gemfile. I am not an expert but through experience it seems that if a gem is included there then I do not have to place ‘requires’. Try yourself.

Also, I would recommend that you try RVM and use gemsets. I create a new gemset for each app, that way I have a clean start for that app and fresh install of the gems. And you can also delete the gemset and start over if you run into any problems and want to round out the possibility that the issue was in your gems.

Paul Bergstrom wrote in post #969811:

Where do I put e g require 'will_paginate' in Rails 3 environment?

http://gembundler.com/rails3.html

Can I still use "require" somewhere without bundler? It's overkill for my situation with a few apps of my own. I just want to get started with Rails 3, which hasn't been easy.

Can I still use “require” somewhere without bundler? It’s overkill for

my situation with a few apps of my own. I just want to get started with

Rails 3, which hasn’t been easy.

Fighting Rails will only make Rails 3 harder, oh have I learned not to do this when not necessary. Bundler was made a first class part of Rails starting in 3, so if you are going to use Rails 3 you should use it. Its really not a big deal different than Rails 2 where you declared your gems in environment.rb. Just include your gems in bundler and run ‘bundle install’ in the terminal…

David Kahn wrote in post #969854:

David Kahn wrote in post #969854:

Fighting Rails will only make Rails 3 harder, oh have I learned not to

do

this when not necessary. Bundler was made a first class part of Rails

starting in 3, so if you are going to use Rails 3 you should use it. Its

really not a big deal different than Rails 2 where you declared your

gems in

environment.rb. Just include your gems in bundler and run 'bundle

install’

in the terminal…

Maybe it’s necessary :slight_smile:

Just give a try— I am usually pretty vocal if something really it troublesome but I have not found such with Bundler, actually I do feel like it makes my life easier – just having clarity what is and what is not in the project.

Paul Bergstrom wrote in post #969853:

Can I still use "require" somewhere without bundler? It's overkill for my situation with a few apps of my own. I just want to get started with Rails 3, which hasn't been easy.

It hasn't been easy for you because you're trying to fight Rails! So...stop fighting Rails. Stop fighting Bundler. Learn to do things the Rails way. If you think you can improve on the Rails way, please do so -- but do so from a position of knowledge, not a position of ignorance.

If you're not willing to do that, then find another Web framework that better suits your needs.

Best,

Marnen Laibow-Koser wrote in post #969862:

It hasn't been easy for you because you're trying to fight Rails! So...stop fighting Rails. Stop fighting Bundler. Learn to do things the Rails way. If you think you can improve on the Rails way, please do so -- but do so from a position of knowledge, not a position of ignorance.

If you're not willing to do that, then find another Web framework that better suits your needs.

Haven't I ask you not to answer my posts? Why can't you respect that?

Paul Bergstrom wrote in post #969888:

Marnen Laibow-Koser wrote in post #969862:

It hasn't been easy for you because you're trying to fight Rails! So...stop fighting Rails. Stop fighting Bundler. Learn to do things the Rails way. If you think you can improve on the Rails way, please do so -- but do so from a position of knowledge, not a position of ignorance.

If you're not willing to do that, then find another Web framework that better suits your needs.

Haven't I ask you not to answer my posts?

I didn't realize it was a blanket prohibition.

Why can't you respect that?

I can't respect the idea that you get to decide who answers you when you post on an unmoderated public list. If you don't want answers from the public, don't post here.

If you have a problem with something I said, or if you think I'm wrong, please feel free to tell me. If you want to killfile me, that's your right too. But ad hominem invalidation is silly.

Oh, wait, I can't answer those direct questions from you. Damn. ;>

Best,

Paul Bergstrom wrote in post #969888:

Marnen Laibow-Koser wrote in post #969862:

It hasn't been easy for you because you're trying to fight Rails! <snip what everyone's telling the OP>

Haven't I ask you not to answer my posts?

*ker-plonk* (the sound of an addition to my killfile :-/

...it's a shame really... some people just don't seem to want help. What's the sense in using software that declaims "convention over configuration", then ignoring conventions, and moaning the configuration is too hard?

Why can't you respect that?

I can't respect the idea that you get to decide who answers you when you post on an unmoderated public list. If you don't want answers from the public, don't post here.

+1

David Kahn wrote in post #969861:

On Tue, Dec 21, 2010 at 1:41 PM, Paul Bergstrom

Just give a try--- I am usually pretty vocal if something really it troublesome but I have not found such with Bundler, actually I do feel like it makes my life easier -- just having clarity what is and what is not in the project.

I see what you mean. But let me give you my view.

I had an easy life with Rails 2 but now with Rails 3 it has become more complex. I just wondered if there was a way to leave bundler out and just use require, as before. If there is, then what's the problem? Isn't that the easy way ahead? I can learn bundler later on if and when needed.

I like simplicity. That's why I got fond of ruby and then rails over php. But I don't think it's going the right way, even though I can see the need for a tool like bundler. I would prefer that Rails keep it simple but let users add tools like bundler if wanted. My setup in Rails 2 was easier. Trust me.

Bundler reminds me of gem vs plugin. Do you see my thought?

Paul Bergstrom wrote in post #969896:

David Kahn wrote in post #969861:

On Tue, Dec 21, 2010 at 1:41 PM, Paul Bergstrom

Just give a try--- I am usually pretty vocal if something really it troublesome but I have not found such with Bundler, actually I do feel like it makes my life easier -- just having clarity what is and what is not in the project.

I see what you mean. But let me give you my view.

I had an easy life with Rails 2 but now with Rails 3 it has become more complex. I just wondered if there was a way to leave bundler out and just use require, as before. If there is, then what's the problem? Isn't that the easy way ahead? I can learn bundler later on if and when needed.

Apparently there isn't. That's what people have been trying to tell you, and that's what you have apparently been ignoring.

Anyway, if you want to learn Rails 3, then learn it, don't kludge around it! If, after having learned it, you think there's a better way to do things, then do so.

I like simplicity. That's why I got fond of ruby and then rails over php. But I don't think it's going the right way, even though I can see the need for a tool like bundler. I would prefer that Rails keep it simple but let users add tools like bundler if wanted. My setup in Rails 2 was easier.

No one is stopping you from continuing to use Rails 2, or from using another Web framework altogether. If Rails 3 is getting in your way, then please don't use it.

However, please invest some honest effort into learning Rails 3 -- on its own merits -- before making that decision.

Trust me.

Why? :slight_smile:

Bundler reminds me of gem vs plugin. Do you see my thought?

No. How about making it explicit?

Best,

Michael Pavling wrote in post #969893:

David Kahn wrote in post #969861:

On Tue, Dec 21, 2010 at 1:41 PM, Paul Bergstrom

Just give a try— I am usually pretty vocal if something really it

troublesome but I have not found such with Bundler, actually I do feel

like

it makes my life easier – just having clarity what is and what is not

in

the project.

I see what you mean. But let me give you my view.

I had an easy life with Rails 2 but now with Rails 3 it has become more

complex. I just wondered if there was a way to leave bundler out and

just use require, as before. If there is, then what’s the problem? Isn’t

that the easy way ahead? I can learn bundler later on if and when

needed.

I like simplicity. That’s why I got fond of ruby and then rails over

php. But I don’t think it’s going the right way, even though I can see

the need for a tool like bundler. I would prefer that Rails keep it

simple but let users add tools like bundler if wanted. My setup in Rails

2 was easier. Trust me.

This is something I have thought about. I came from the .NET world for a lot of same reasons. I have been using Rails 3 for a few months intensively and I think you should give it an honest shot. There are changes and there is a learning curve but it is not that bad. My challenge is that I also took on Rspec, Cucumber, Capybara, xpath and who knows what else at the same time and this was painful but I am seeing that it has made me stronger. I have ended up dropping Cucumber for Steak and this has helped. Anyhow, I suspect that you will find that it just seems easier in 2 because it is what you are used to.

Also… if you really want to simplify, check out developing a pure rack app or with Sinatra or the like… pretty cool stuff and you feel closer to the road :wink:

Bundler reminds me of gem vs plugin. Do you see my thought?

I am probably wrong but it seems to me that plugins are and will go away as since each app has their own bundle the idea of plugins gets to be insignificant, especially if you use RVM (and RVM is for sure worth the effort to pick up).

Marnen Laibow-Koser wrote in post #969891:

I didn't realize it was a blanket prohibition.

Why can't you respect that?

I can't respect the idea that you get to decide who answers you when you post on an unmoderated public list. If you don't want answers from the public, don't post here.

I only ask you to respect me as a fellow human being, asking you to behave and interact with other people in a kind, respectful and warm manner. :slight_smile: Is that too much to ask?

Several times when I have asked a question you have given me a question back like "why do you want to do that?" instead of just answering my question. Once or twice is nothing but not all the time.

I didn't ask for your opinion about bundler. I asked if there is a way to require a gem but keep the gems in one place, like before. I don't understand why that question would be so hard to understand. Why make it so complicated Marnen?

I'm sure bundler is wonderful, but I could do without it. Is that ok with you? You seem like a person who get nervous when someone is not following the rules. Is that true? Is that the problem here?

David Kahn wrote in post #969902: [...]

I have ended up dropping Cucumber for Steak and this has helped.

[...]

Now that's just a terrible idea. I don't want to hijack this thread, but I'll be happy to discuss (in a different thread) why I think Steak is fundamentally misconceived.

Best,

David Kahn wrote in post #969902:

Rspec, Cucumber, Capybara, xpath and who knows what else at the same time

I get exhausted of hearing about all that stuff :slight_smile:

Just kidding. I see your point. I'm kind of full with knowledge. I'm tired of always having to learn new things. Once I was eager to do so, but not anymore.

I had a good life with Rails 2. Things worked well and I felt I had learned all I needed to have a good flow in my development (of my own few apps). Then came Rails 3 with some "cool new features". :slight_smile:

Bundler reminds me of gem vs plugin. Do you see my thought?

I am probably wrong but it seems to me that plugins are and will go away as since each app has their own bundle the idea of plugins gets to be insignificant, especially if you use RVM (and RVM *is* for sure worth the effort to pick up).

I use RVM. Good for ruby. But otherwise I could be without it. It's one of these "cool new features" that I had to get into. :slight_smile: My head is alarming "memory full".