Unable to access rails console - ruby-on-rails-4

I have deployed my application onto openshift and everything is working great until I tried to access the rails console.
ssh openshiftsshlogin
cd ~/app-root/repo/
rails c
When I run the above command I get this error.
bash: rails: command not found
My web application is open source which may help to diagnose the error.
Link to the Github repository.
Also when I run...
bundle exec rails c
I get the following error,
bundler: command not found: rails
Install missing gem executables with `bundle install`
/usr/lib/ruby/gems/1.8/gems/bundler-1.5.2/lib/bundler/friendly_errors.rb:10:in `with_friendly_errors': uninitialized constant Thor::AmbiguousTaskError (NameError)
from /usr/lib/ruby/gems/1.8/gems/bundler-1.5.2/bin/bundle:20
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
I dont belive i need to manually install the rails gem as the gear is running a rails application just fine.

try RAILS_ENV=production bundle exec rails console

So weirdly enough I solved the issue by just running "gem install rails" even though I should not of needed to. So if a future person runs into this issue just run...
gem install rails
RAILS_ENV=production bundle exec rails console
That should solve the issue.

Related

rails-rspec error cannot load such file -- rspec/core/formatters/progress_formatter

I've broken my rails-rspec. I switched to a different gemset to run a 3rd party test. When I returned to my 2.3.0(default) gemset, I had the following errors.
running rspec gets:
/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- rspec/core/formatters/progress_formatter (LoadError)
running rails generate rspec:install returns:
Could not find generator 'rspec:install'. Maybe you meant 'devise:install' or ...
I have tried uninstalling and reinstalling, but errors persist.
Running rspec -v returns:
- rspec-core 3.6.0
- rspec-expectations 3.6.0
- rspec-mocks 3.6.0
- rspec-rails 3.6.1
- rspec-support 3.6.0
It seems that ruby cannot find rspec-core. I have tried the workaround from this post without success. Thank you in advance for any insight you might provide.
Running
rails 4.2.0, ruby 2.3.0
Running bundle exec rspec solved it for me.
Running bundle clean --force did the trick for me, turns out there's some outdated gem in my system
I learned this from Victor Hazbun - expert on CodeMentor and Egghead.io:
Run gem list | grep rspec and pay attention to any gems that list multiple versions.
Then run gem uninstall ______ for each of those versions (removing ALL of the versions of each).
Then run bundle afterward. This will sync your versions with the versions in your gemfile.
I was getting the error below in a rails app and none of the solutions here worked for me.
gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:210:in `require': cannot load such file -- rspec/core/formatters/progress_formatter (LoadError)
Emptying the gemset and re-installing did.
This assumes you are using rvm and a .ruby-gemset at the root of your app.
$ rvm gemset empty <name-of-gemset>
$ bundle install
I think you should try
bundle exec rspec:install
I was trying to make a contribution to CocoaPods and was getting the same error when I was doing rspec foo_spec.rb. Turns out they were NOT using rpsec at all. They seem to have had a special test runner:
CocoaPods uses bacon as a test runner. To run all tests, use bundle exec rake spec in the root of the project. If you want to run a specific test instead, use bundle exec bacon spec/[folder]/[name]_spec.rb
For more on that see here
If you run the specs from RubyMine, you can specific the RSpec version in Run Configuration.

Rails Error in Terminal

My code was working fine yesterday and then after I reverted some changes from git I am getting this error
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:34:in `block in setup': You have already activated spring 1.3.4, but your Gemfile requires spring 1.3.3. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
I am unsure how to fix this I have ran the bundle command in terminal with still no luck! Please HELP MEEEE!!!!
I found the answer here for anyone looking to solve the same or similar issue:Couldn't run migration after spring update in Rails
You need to run bundle update spring in terminal

redmine : due date remainder not migrating

I am currently developing a project management system using Bitnami Redmine. I am using Redmine 1.4.7.
I found a plugin on https://github.com/f0y/due_date_reminder/tree/redmine-1.4 which I want use on my project. I copied the plugin to C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs\vendor\plugins. I followed the instructions provided but when I try to install the plugin it does not get migrated.
I'm running this command in C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs:
bundle exec rake db:migrate_plugins rails_env=production
and receive the following error:
Expected C:/BitNami/redmine-1.4.7-2/apps/redmine/htdocs/app/models/user.rb to define User
Tasks: TOP => db:migrate_plugins => environment
See full trace by running task with --trace
I don't get what is the problem with the user.rb file. Please help.

Could not find i18n-0.6.4 in any of the sources (Bundler::GemNotFound)

Opened up a Rails project I haven't coded in a while and I just tried starting up the Rails server with:
`rails s`
and I get this error message:
.rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find i18n-0.6.4 in any of the sources (Bundler::GemNotFound)
Fwiw, I've done a bundle install and here's what I get when I check i18n:
$ gem list i18n
*** LOCAL GEMS ***
i18n (0.6.5)
Any idea what the problem is and how it should be fixed?
In case your rails gem is in the Gemfile, you should run
bundle exec rails s
instead. HTH.
There may be an issue with how you installed RVM.
Try calling gem list and see if it's mentioned anywhere there.
There's a Rails guide to internationalization API. It may contain useful information if reintalling RVM doesn't fix anything
http://guides.rubyonrails.org/i18n.html

No application integration exists for rails. Compass and rails 4

I started a rails 4 project and added the following gem (supposedly, it has rails 4 support)
gem 'compass-rails', '~> 2.0.alpha.0'
However, after bundle install and $ bundle exec compass init I keep getting
No application integration exists for rails.
Anyone knows why ?
Thanks,
I get the same error with compass-rails v1.1.3 and rails 4, when running "bundle exec compass init rails", but when I run "bundle exec compass init" (omitting "rails") it works fine for me. The version of compass-rails you are using has been yanked since last July (see here: http://rubygems.org/gems/compass-rails/versions/2.0.alpha.0).
Remove project_type = :rails from your config file.