paneq / active_reload Goto Github PK
View Code? Open in Web Editor NEWReload Rails code in development mode only when change is deteced
License: Other
Reload Rails code in development mode only when change is deteced
License: Other
Getting this error every time the project is loaded (and all the gems):
Invalid gemspec in [/Users/tanel/.rvm/gems/ruby-1.9.2-p180@project/specifications/active_reload-0.2.0.gemspec]: invalid date format in specification: "2011-07-20 00:00:00.000000000Z"
The gemspec itself looks like this at that location:
Gem::Specification.new do |s|
s.name = %q{active_reload}
s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Robert Pankowecki"]
s.date = %q{2011-07-20 00:00:00.000000000Z}
s.description = %q{Reload Rails code in development mode only when change is deteced}
s.email = ["[email protected]"]
s.homepage = %q{https://github.com/paneq/active_reload}
s.require_paths = ["lib"]
s.rubyforge_project = %q{active_reload}
s.rubygems_version = %q{1.7.2}
s.summary = %q{Reload Rails code in development mode only when change is deteced}
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<rake>, [">= 0"])
s.add_development_dependency(%q<bbq>, [">= 0"])
else
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<bbq>, [">= 0"])
end
else
s.add_dependency(%q, [">= 0"])
s.add_dependency(%q, [">= 0"])
end
end
The date clearly is in the wrong format, but the gemspec does not resemble the one in your repository.
Do you use something else to generate the gemspec before releasing?
When migrating an old rails 3.1.x app to rails 3.2.0 assets are no longer served when active_reload is in the Gemfile (404 not found). This can easily by reproduced by creating a brand new 3.2 rails app and adding active_reload to the Gemfile.
As active_reload is not needed for rails 3.2 anymore, I'd suggest to put a big warning in the README making users aware of this bug/ problem. See this issues here too: rails/rails#2715
Add tests for Rails 3.1.0.rc5
I have a mid sized app (56 models). Without active_reload in my development group, my homepage gets loaded in about 3 seconds in development (that's mostly asset loading). With active_reload included, it jumps to 5 1/2 seconds.
Using rails 3.1, ruby 1.9.2p290 and active_reload 0.6.0.
Hello, I have trouble with active_reload.
I've set locale from a query:
class ApplicationController < ActionController::Base
before_filter :set_locale
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
logger.debug "Current locale: #{I18n.locale}"
end
end
Default locale is:
config.i18n.default_locale = :en
And then I make 2 GET queries:
First query:
Started GET "/en" for 127.0.0.1 at 2011-07-26 21:20:39 +0600
Processing by PostsController#index as HTML
Parameters: {"locale"=>"en"}
Current locale: en
SQL (0.3ms) SHOW TABLES
Post Load (0.1ms) SELECT posts
.* FROM posts
WHERE posts
.locale
= 'en' AND (posts.deleted_at IS NULL) ORDER BY created_at DESC LIMIT 2 OFFSET 0
SQL (0.1ms) SELECT COUNT(*) FROM posts
WHERE posts
.locale
= 'en' AND (posts.deleted_at IS NULL)
Second query:
Started GET "/ru" for 127.0.0.1 at 2011-07-26 21:20:44 +0600
Processing by PostsController#index as HTML
Parameters: {"locale"=>"ru"}
Current locale: ru
Post Load (0.1ms) SELECT posts
.* FROM posts
WHERE posts
.locale
= 'en' AND (posts.deleted_at IS NULL) ORDER BY created_at DESC LIMIT 2 OFFSET 0
SQL (0.1ms) SELECT COUNT(*) FROM posts
WHERE posts
.locale
= 'en' AND (posts.deleted_at IS NULL)
As you can see in second GET query we have "ru" locale in params, but for AR query we got "en"! When I removed active_reload from Gemfile then all became working!
Rails 3.0.9 + Ubuntu 10.10
Could you please indicate under which license this code is released? As far as I could tell this currently isn't mentioned.
Getting following error:
/Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/active_reload-0.1.0/lib/active_reload.rb:12:in replace?': You have a nil object when you didn't expect it! (NoMethodError) You might have expected an instance of Array. The error occurred while evaluating nil.last from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/active_reload-0.1.0/lib/active_reload.rb:22:in
replace!'
from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/active_reload-0.1.0/lib/active_reload.rb:7:in block in <class:Railtie>' from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/initializable.rb:25:in
instance_exec'
from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/initializable.rb:25:in run' from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/initializable.rb:50:in
block in run_initializers'
from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/initializable.rb:49:in each' from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/initializable.rb:49:in
run_initializers'
from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/application.rb:96:in initialize!' from /Users/heli/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0.rc4/lib/rails/railtie/configurable.rb:30:in
method_missing'
After gem installation, when the server starts I received:
/home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/active_reload-0.1.0/lib/active_reload.rb:18:in `replace_proc?': undefined method `source_location' for #<Proc:0xb5d97064> (NoMethodError)
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/active_reload-0.1.0/lib/active_reload.rb:12:in `replace?'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/active_reload-0.1.0/lib/active_reload.rb:22:in `replace!'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/active_reload-0.1.0/lib/active_reload.rb:7
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
from /home/leszek/lingapp/config/environment.rb:4
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /home/leszek/lingapp/config.ru:2
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
from /home/leszek/.rvm/gems/ruby-1.8.7-p334/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
from /home/leszek/lingapp/config.ru:1:in `new'
from /home/leszek/lingapp/config.ru:1
Seems that changes to e.g. stylesheets are not being refreshed, Rails 3.1rc6 and not using sprockets yet (just static files in /public/stylesheets etc.)
Great gem if all of these things work. Should have been part of Rails from day one.
Check out: 3.0.10rc
version
/home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/active_reload-0.2.0/lib/active_reload.rb:34:in replace_proc?': undefined method
source_location' for #Proc:0xc9fde0c (NoMethodError)
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/active_reload-0.2.0/lib/active_reload.rb:12:in replace?' from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/active_reload-0.2.0/lib/active_reload.rb:38:in
replace!'
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/active_reload-0.2.0/lib/active_reload.rb:7
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/initializable.rb:25:in instance_exec' from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/initializable.rb:25:in
run'
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/initializable.rb:50:in run_initializers' from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/initializable.rb:49:in
each'
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/initializable.rb:49:in run_initializers' from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/application.rb:134:in
initialize!'
from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/application.rb:77:in send' from /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/railties-3.0.5/lib/rails/application.rb:77:in
method_missing'
active_reload doesn't work with activeadmin, the menu is not rendered anymore after the first request
I had following issue with Spree 0.70.3:
spree_promo has to_prepare call, which calls alias_method_chain
when code wasn't reloaded - to_prepare call was called and creating another alias_method_chain
resulting in infinite recursion
I made simples working solution for Rails 3.1. From what I saw it shouldn't be hard to get it working in Rails 3.0.
This multi to_prepare loading without proper cleaning can result in weird errors... I spent almost 7 hours tracking it down.
Here is my solution - https://gist.github.com/1440449
Feel free to use it if you want.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.