railtie

Previewing Mailers on non-development tiers

我是研究僧i 提交于 2020-05-28 18:44:35
问题 I have several mailer previews under spec/mailer/previews . On development I can view all the previews under /rails/mailers/ . However by default this functionality does not exist on other environments. I wanted to enable it on the staging environment and took a queue from this post here. I made the following changes - config/routes.rb # Add the routes manually if Rails.env.staging? get "/rails/mailers" => "rails/mailers#index" get "/rails/mailers/*path" => "rails/mailers#preview" end config

Previewing Mailers on non-development tiers

房东的猫 提交于 2020-05-28 18:39:20
问题 I have several mailer previews under spec/mailer/previews . On development I can view all the previews under /rails/mailers/ . However by default this functionality does not exist on other environments. I wanted to enable it on the staging environment and took a queue from this post here. I made the following changes - config/routes.rb # Add the routes manually if Rails.env.staging? get "/rails/mailers" => "rails/mailers#index" get "/rails/mailers/*path" => "rails/mailers#preview" end config

Rails::Railtie: Trouble creating a Rails 3 gem

核能气质少年 提交于 2020-01-03 18:52:13
问题 I could really use another set of eyes on this so I thought I would post it here. A while ago I wrote a basic ActiveRecord Extension for my own educational purposes. I've been reading about Railties lately and thought I would try to get it working with Rails 3. I thought I would package it up as a gem to get a sense of that process as well. If I skip the Railtie and just do this as a traditional monkeypatch in the initializers folder it works fine. Using a Railtie... nothing. From the looks

Rails::Railtie: Trouble creating a Rails 3 gem

大兔子大兔子 提交于 2020-01-03 18:52:08
问题 I could really use another set of eyes on this so I thought I would post it here. A while ago I wrote a basic ActiveRecord Extension for my own educational purposes. I've been reading about Railties lately and thought I would try to get it working with Rails 3. I thought I would package it up as a gem to get a sense of that process as well. If I skip the Railtie and just do this as a traditional monkeypatch in the initializers folder it works fine. Using a Railtie... nothing. From the looks

Why Railtie initializers are not executed?

£可爱£侵袭症+ 提交于 2019-12-08 17:24:38
问题 While crafting the Passenger-Monit plugin, I thought that it'll be most appropriate to use the initializer, i.e. module PassengerMonit class Railtie < Rails::Railtie initializer "my_plugin.some_init_task" do # my initialization tasks end end end However, for some reason the code in the block was never executed. I finally made a work-around with config.before_initialize {} but I'm curious, why the initializer wasn't executed. What could have prevented it from running? 回答1: In your gemfile, did

mobile_fu for Rails 4

帅比萌擦擦* 提交于 2019-12-07 02:41:13
问题 I'm trying to switch my app from Rails 3.2.13 to Rails 4. In doing so, I've hit one main snag -- I use the gem mobile_fu in order to determine if users are coming from a mobile device. That gem requires railties 3.2.13, but rails 4.0.2 and sass-rails for rails 4.0.2 both require railties >= 4.0. What's a good way to solve this problem? I'm happy to dig into the mobile_fu code as it doesn't seem particularly tricky, but I have very little experience dealing with railties and what dependencies

mobile_fu for Rails 4

你。 提交于 2019-12-05 08:16:28
I'm trying to switch my app from Rails 3.2.13 to Rails 4. In doing so, I've hit one main snag -- I use the gem mobile_fu in order to determine if users are coming from a mobile device. That gem requires railties 3.2.13, but rails 4.0.2 and sass-rails for rails 4.0.2 both require railties >= 4.0. What's a good way to solve this problem? I'm happy to dig into the mobile_fu code as it doesn't seem particularly tricky, but I have very little experience dealing with railties and what dependencies on railties mean. Thanks! You can try using the more latest version of mobile-fu at https://github.com

Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

血红的双手。 提交于 2019-11-30 04:39:54
I am trying to upgrade to Rails 4.0.0, and I changed the gem versions of sass-rails and coffee-rails . I need to resolve this gem conflict between rails and coffee-rails before I can upgrade to Rails 4. When I ran bundle update this is the output I got: $ bundle update Updating git://github.com/pilu/web-app-theme.git Fetching source index from https://rubygems.org/ Resolving dependencies.............. Bundler could not find compatible versions for gem "railties": In Gemfile: rails (= 4.0.0) ruby depends on railties (= 4.0.0) ruby coffee-rails (= 4.0.0) ruby depends on railties (4.0.0.rc2) My

Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

夙愿已清 提交于 2019-11-29 02:06:51
问题 I am trying to upgrade to Rails 4.0.0, and I changed the gem versions of sass-rails and coffee-rails . I need to resolve this gem conflict between rails and coffee-rails before I can upgrade to Rails 4. When I ran bundle update this is the output I got: $ bundle update Updating git://github.com/pilu/web-app-theme.git Fetching source index from https://rubygems.org/ Resolving dependencies.............. Bundler could not find compatible versions for gem "railties": In Gemfile: rails (= 4.0.0)

cannot load railtie after upgrade to rails 4 per ruby.railstutorial.org

十年热恋 提交于 2019-11-28 09:35:23
OS is Ubuntu 12.04, 64 bit. New to rails. Relatively new to Ruby. Following the ruby.railstutorial.org tutorial, chapter 3. The tutorial has been updated to use ruby 2.0.0 and Rails 4.0.0.rc1. Previously the gemfile was specifying Rails 3.2.13 and not specifying Ruby version. After moving to the latest Gemfile in the tutorial, ruby 2.0.0 and Rails 4.0.0.rc1, I'm getting the following error when running rails commands. Example here is rails server user@machine:~/bin/railslearn/sample_app$ rails server /home/paul/bin/railslearn/sample_app/config/application.rb:7:in `require': cannot load such