# First, above the Rails::Initializer.run block put

**URL:** <https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455>\
**Category:** Rails\
**Created:** [May 13, 2008, 10:11am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455 "2008-05-13T10:11:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [May 13, 2008, 10:11am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455/1 "2008-05-13T10:11:09Z")

</div>

I’m puzzling through these instructions:

> **[钛刻专家——官网](https://www.texperts.com/2007/12/21/using-action-web-service-with-rails-20/)**
>
> 钛刻专家致力于打造一个全球专家在线服务平台，为机构和个人对接高水平行业专家，为机构提供更系统性的线下定制专家服务。

And I’ve gotten as far as the instructions that read … “First,  
above the Rails::Initializer.run block put …” but I don’t have any  
“Rails::Initializer.run” block.

Am I missing something? I’m trying to get something running again that  
I didn’t actually build. I can’t tell whether the original author was  
leaving things out or what.

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [May 13, 2008, 10:23am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455/2 "2008-05-13T10:23:39Z")

</div>

On 13 May 2008, at 03:31, Amanda wrote:

> I’m puzzling through these instructions:
> 
> [钛刻专家——官网](http://www.texperts.com/2007/12/21/using-action-web-service-with-rails-20/)
> 
> And I’ve gotten as far as the instructions that read … “First,  
> above the Rails::Initializer.run block put …” but I don’t have any  
> “Rails::Initializer.run” block.

Then you’re probably not looking in the right file, because rails  
wouldn’t run without it.

Fred

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [May 14, 2008, 1:04am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455/3 "2008-05-14T01:04:53Z")

</div>

So if …

grep -ir “Rails::Initializer” ./\*

turns up nothing, you think I didn’t get all the files I need?

On May 13, 4:23 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [May 14, 2008, 1:11am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455/4 "2008-05-14T01:11:56Z")

</div>

Ignore this for now. Or don’t. I have a basic app, the output of  
“rails myapp” and I can see where it does have those lines:

./myapp/config/boot.rb: defined? Rails::Initializer  
./myapp/config/boot.rb: Rails::Initializer.run(:set\_load\_path)  
./myapp/config/environment.rb:Rails::Initializer.run do |config|

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [May 18, 2008, 1:53am UTC](https://www.ruby-forum.com/t/first-above-the-rails-initializer-run-block-put/137455/5 "2008-05-18T01:53:19Z")

</div>

environment.rb is the file you’re looking for. This is where the global  
settings of your Rails app go.

“class Rails::Configuration … end” goes before the  
Rails::Initializer.run  
block. The lines starting with “config” go inside the  
Rails::Initializer.run block.
