sporkrb / spork-rails

Spork plugin for rails
MIT License
184 stars 45 forks source link

Fix problem due to the difference of the implementation of Ruby 1.9.x and 2.0.0. #16

Closed A-gen closed 11 years ago

A-gen commented 11 years ago

I think attempting to use spork-rails with rails4 but did not work in ruby 2.0.0. I hope this pull request will help to support rails4.

umid-podo commented 11 years ago

Great!! It works with rails4 and ruby2.0

crnastena commented 11 years ago

Thanks A-gen! If you are using RoR Tutorial 4.0.0, replace

gem 'spork-rails', github: 'railstutorial/spork-rails', branch: 'rails-4'

with:

gem 'spork-rails', github: 'A-gen/spork-rails'
railstutorial commented 11 years ago

I've updated the tutorial's Gemfile to point to a fork of 'A-gen/spork-rails', so

gem 'spork-rails', github: 'railstutorial/spork-rails'

now works.

bmwertman commented 11 years ago

When running the spork --bootstrap command as follows: $ bundle exec spork --bootstrap

I get the following error: /usr/local/rvm/gems/ruby-2.0.0-p0/bin/spork:23:in load': cannot load such file -- /usr/local/rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/bin/spork (LoadError) from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/spork:23:in

' from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in eval' from /usr/local/rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in
'

Not sure why I'm getting this error.

With Gemfile as follows: source 'https://rubygems.org' ruby '2.0.0'

gem 'rails', '4.0.0.beta1'

group :development, :test do gem 'sqlite3', '1.3.7' gem 'rspec-rails', '2.13.0' gem 'guard-rspec', '2.5.0' gem 'spork-rails', github: 'railstutorial/spork-rails' gem 'guard-spork', '1.5.0' end

group :test do gem 'selenium-webdriver', '2.0' gem 'capybara', '2.1.0.beta1'

Uncomment these lines on OS X.

gem 'rb-fsevent', '0.9.3', :require => false

gem 'growl', '1.0.3'

Uncomment these lines on Linux.

gem 'rb-inotify', '0.9.0'

gem 'libnotify', '0.8.0'

Uncomment these lines on Windows.

gem 'rb-fchange', '0.0.6'

gem 'rb-notifu', '0.0.4'

gem 'win32console', '1.3.2'

end

group :assets do gem 'sass-rails', '4.0.0.beta1' gem 'coffee-rails', '4.0.0.beta1' gem 'uglifier', '1.0.3' end

gem 'jquery-rails', '2.2.1' gem 'turbolinks', '1.0.0' gem 'jbuilder', '1.0.1'

group :production do gem 'pg', '0.14.1' end Any help is appreciated.

A-gen commented 11 years ago

Hi @bmwertman . Sorry, I couldn't reproduce it. I guess that /usr/local/rvm/gems/ruby-2.0.0-p0/gems/spork-1.0.0rc3/bin/spork is not exist. Umm... failed bundle install for some reason?

bmwertman commented 11 years ago

Hi @A-gen,

I was following @railstutorial latest rails 4.0 tutorial. There was a notice in that a couple of pages down from where I was working that Guard and Spork do not currently work together with rails 4.0. I think the above error may be related to that.

bwobst commented 11 years ago

@bmwertman I'm having the same problem right now. How did you fix it?

bmwertman commented 11 years ago

Hi bwobst,

I don't have my Macbook. Had to send it back to Apple for a hardware issue :-( So I can't really elaborate on what I did right now. See the issue below. I think it details the fix.

https://github.com/wayneeseguin/rvm/issues/1884#issuecomment-17748164

sahilm commented 11 years ago

This has been fixed in 3224f84. Sorry that I couldn't merge your pull request. I was in the process of making a much larger change.

Support for Rails 4, Ruby 2.0, Cucumber 1.3.2 and Rspec 2.13.0 has landed on master. Please help me test by including spork-rails, :github => 'sporkrb/spork-rails' in your Gemfile.

CI builds for spork and spork-rails have been setup at https://travis-ci.org/sporkrb/spork and https://travis-ci.org/sporkrb/spork-rails respectively.

railstutorial commented 11 years ago

This is excellent news, and it looks like it works with the Rails Tutorial sample app.

kjmario78 commented 11 years ago

git://github.com/railstutorial/spork-rails.git (at master) is not checked out. Please run bundle install

sahilm commented 11 years ago

Just released spork-rails 4.0.0 to RubyGems. It's no longer necessary to pull the gem from GitHub.

railstutorial commented 11 years ago

Awsome! Great work. I've updated the Ruby on Rails Tutorial book accordingly.