Installing/Running Spork-Rails on Rails 4 - ruby-on-rails

After installing spork-rails I get this error when running 'spork':
Andrews-Mac-Pro-4:lb_final chapmanf16$ spork
/Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in load': cannot load such file - - /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/gems/spork-1.0.0rc3/bin/spork (LoadError)
from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in'
from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in eval'
from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in'
If I run 'sudo spork' none of my gems are being located. I will get the following errors:
Using RSpec, Rails
Preloading Rails environment
Could not find actionpack-4.0.0 in any of the sources
It literally can't find any gems because if I list the versions of the gem being mentioned and install only the version it is asking for, it will tell me the next gem is not install. I'm just trying to figure out why the path to my gemfile is not being recognized by spark. I have only started learning ruby/rails for the past 3 days so I'm completely out of my element, but I am really not sure what to do. Any help would be appreciated.
I also posted this question I have on spark-rails github -https://github.com/sporkrb/spork-rails/issues/20

spork-rails from RubyGems doesn't support Rails 4. Try to update you Gemfile with a github reference for the spork:
gem 'spork-rails', github: 'sporkrb/spork-rails'
and run bundle update

Related

Ruby failing to run after upgrading (sqlite3_native LoadError); sqlite3 not upgrading properly

I have upgraded to ruby 2.5.0 but I am having conflicts everywhere. I have checked previous posts on stack overflow such as:
Ruby on Rails - "Add 'gem sqlite3'' to your Gemfile"
cannot load such file — sqlite3/sqlite3_native
cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails
https://github.com/sparklemotion/sqlite3-ruby/issues/137
But none of them are working for me. My issue is similar to these posts in that after I run rails server after a long error message the last few lines read:
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in 'block in require'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 'require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
I have tried creating a new project, reinstalling sqlite3 through gem and minigw itself, reinstalling rails and ruby. I have tried most of the instructions in the previous questions but nothing works. SQLite3 version 3.25.2, Ruby 2.5.3, rails 5.2.1
Sorry, this might be a simple fix but I am a complete beginner to ruby and I have been trying different things for a few hours now. Any help is appreciated.
As explained in this answer https://stackoverflow.com/a/49736971/4685144, you should now be able to install sqlite3 using git:
gem 'sqlite3', git: 'https://github.com/sparklemotion/sqlite3-ruby'
Then bundle install

Rails deployment Capistrano - capistrano/cli (LoadError)

I followed this tutorial.
https://gorails.com/deploy/ubuntu/14.04#capistrano
Now i am stuck at this
I ran this command after set Adding The Nginx Host
cap production deploy
and ran into this, now no idea what to do.
/home/deploy/.rbenv/versions/2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- capistrano/cli (LoadError)
from /home/deploy/.rbenv/versions/2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /usr/bin/cap:3:in `'
I solve this problem by remove old Capistrano gem.
# remove all old versions of the gem
gem cleanup rjb
I have the same error and it's because I installed this Gem and upgraded my ruby from 2.0.0 to 2.1.9. Reinstallation resolves my issue.
Hope this can help you.
If you still have this problem, I highly recommend you use bundler and
bundle exec cap <args>

cannot load such file -- devise/schema (LoadError)

After I added the devise_rpx_connectable gem to my Gemfile, I cannot run rails server anymore or migrate to add a column to my Users table. I'm trying to follow the railscast example here:
http://railscasts.com/episodes/233-engage-with-devise?view=comments
I have tried several things over the last two days to try getting this thing to work. I've tried creating the migration file myself but when I run 'rake db:migrate --trace' the error I get is "rake aborted! cannot load such file -- devise/schema" and a lot of errors underneath starting with:
C:/.../devise/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251 in 'require'
I have tried googling this question and only found a handful of people with the same issue, none of which had their questions answered. Seems other people with 'cannot load such file' errors were told their versions of certain gems weren't compatible so I'll provide that info here:
Gemfile:
gem 'rails', '3.2.6'
gem 'devise', '2.1.2'
gem 'devise_rpx_connectable', '0.2.2'
Also my bundler version is 1.1.4 and my ruby version is 1.9.3
The only thing that stands out to me is that the version of ruby in the devise folder seems to be 1.9.1 and mine is 1.9.3 but I would like to know the possible consequences of downgrading to 1.9.1.
Any input would be greatly appreciated!
Thanks
So we decided to delete the contents of the schema.rb file that "require 'devise/schema.rb'" was in and our app magically worked! I had no idea the implications of this so i did some more research and found this-
https://github.com/nbudin/devise_cas_authenticatable/commit/44aacb23fb5b4cc9d22434c952b9d1d88fe28e88#commitcomment-1555733
turns out that with the newer version (> 2.1) of devise, the contents of this file aren't necessary. hope this solves a lot of other peoples issues, especially if they decide to update the devise gem and continue to use devise_rpx_connectable.

Newly installed gem not loading in RVM

I am having some issues getting Machinist and Sham working for my new rails project. In the past I've used Factory-girl.
I've got rvm installed and I installed machinist by adding it to my gemfile.
When I run rake i get the following error...
/Users/liamnorton/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require': no such file to load -- sham (LoadError)
Which is caused by the line at the top of my blueprints.rb file
require 'sham'
Can someone please help me get this working. I've had issues with RVM in the past and don't want to be imploding and rebuilding if I don't have to!!
Well surprise surprise, including the line gem 'sham' in my gemfile worked!
I thought that Sham was dependent on Machinist, and therefore would be install when running bundle install but no. Machinist 2 wipes it's hands clean.

Error while running rails on windows 7

I am trying to set my machine up so I can follow this tutorial: the intro to rails screen-cast i wish i had.
I keep running into issues, most recently the following:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/ansi-1.4.1/lib/ansi/code.rb:5:in `require':
no such file to load -- Win32/Console/ANSI (LoadError)
This occurs when ever I run rails g. (I would like to see if my r spec generator has been added.)
Environment details: Windows 7, ruby 1.9.2p290, rails 3.1.1, rubygems 1.8.15
After you installed "gem install win32console", can you add this gem into your Gemfile file and try to run bundle install again?
Gemfile
gem "win32console", "~> 1.3.0"
RailsInstaller may be your best bet if you're looking for an integrated Windows Rails experience.
It's up-to-date (-ish, doesn't use Ruby 1.9.3) with:
Ruby 1.9.2-p290
Rails 3.1.1
Git 1.7.6
and other useful bits.

Resources