uninitialized constant Compass in rails 3 app - ruby-on-rails-3

I was trying to use fancy-buttons gem in my rails 3 app but now I can not even start my local server because of this error:
$:~/rails/project$ rails server
/usr/lib/ruby/gems/1.8/gems/fancy-buttons-1.0.6/lib/fancy-buttons.rb:1: uninitialized constant Compass
(NameError)
This is what my gemfile looks like:
gem "fancy-buttons"
gem 'haml'
gem 'haml-rails'
gem 'compass', ">= 0.10.6"
I've ran bundle update and bundle install
Using haml (3.0.25)
Using compass (0.10.6)
Using fancy-buttons (1.0.6)
How can I fix this?

Compass needs to come before fancy-buttons in your gemfile. This ensures that it is loaded before fancy-buttons tries to require it as the gems in your gemfile are loaded in order.

Related

Rails can't install gem sqlite

Gem files will remain installed in
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.0 for
inspection.
Results logged to
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/sqlite3-1.4.0/gem_make.out
An error occurred while installing sqlite3 (1.4.0), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.4.0' succeeds before bundling.
I tried to install earlier version on sqlite, not working.
Tried one of the solutions from stackoverflow :
gem 'sqlite3', '~> 1.3.6'
getting this error
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command sqlite3,
Please help i'm new in Rails , this is my first project in rails.
Add gem 'sqlite3' to Gemfile in the root directory of your rails project. Then run bundle install and it should install sqlite and make it available to use in your rails project.
Specify git and branch for the gem sqlite3 in your Gemfile should fix the problem.
gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
For more info
https://medium.com/#declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b
cannot load such file — sqlite3/sqlite3_native (LoadError) Ruby on Rails
Replace gem 'sqlite3' with gem 'sqlite3', '~> 1.3.11' which is in Gemfile in the root directory of your rails project. Then run bundle install.

Bundler::GemRequireError when adding gem

When I make a new Rails project, add gem 'reactive-record', and run rails server, I get a Bundler error: There was an error while trying to load the gem 'reactive-record'. (Bundler::GemRequireError).
What gives? I have Rails 4.2.5 and Ruby 2.1.2.
Cheers!
The latest version of the generator should work very well with the help of Mitch. We collaborated together to make a generator in order to simplify greatly the installation of react.rb and reactive-record.
You should be able to get up and running by adding to your gem file :
gem 'reactive_rails_generator'
Then do a bundle install
and finally :
rails g reactrb:install --all
bundle update
Will install you reactrb, reactive-record and reactive-router.
Once installed, you can create components by doing :
rails g reactrb:component Home::Show
I worked around the problem like this:
Set rvm to use Ruby 2.2.2 and Rails 4.2.4.
Download https://codeload.github.com/catprintlabs/reactive-record/zip/master
Edited reactive-record-master/Gemfile to read:
gem 'reactive-ruby'
gem 'opal'
gem 'opal-browser'
gem 'react-rails'
cd reactive-record-master/spec/test_app
bundle install
rails server
This seemed to work.
Then, I made a new Rails 4.2.4 project. Adding only gem 'reactive-record' to the Gemfile resulted in the same error. Then I made the Gemfile read:
gem 'reactive-ruby'
gem 'opal'
gem 'opal-browser'
gem 'react-rails'
gem 'reactive-record'
And voila, rails server works!
Hope this helps someone else.

ruby on rails server is not running

i m new to ruby on rails can any one help me. i cant start my rails server below is the error which m getting
i also tried by installing bundle but getting same error
ahaad#Labbaik:~/Desktop/Ruby_Pro/App_demo$ rails server
Could not find gem 'jquery-rails (>= 0) ruby' in the gems available on this machine.
Run bundle install to install missing gems.
Install this gem separately:
gem install jquery-rails
and run the bundle:
bundle install
(or)
Look up your Gemfile, add gem 'jquery-rails' if Gemfile not contain it, then at your terminial, run
bundle install

spree install undefined method mass_assignment_sanitizer

I took a look about this problem within the list of question but nothing helped.
This is my first question in stackoverflow so please accept my apologies in case I do something wrong. Also I still have a lot of english to improve.
I'm installing Spree following the github instructions
$ gem install spree
$ rails new my_store
$ spree install my_store
when I get this message
...
Admin Password [spree123]
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "./my_store"
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
precompiling assets
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
...
Well, as the guide suggests, in case of circular dependency issues do:
$ gem install spree_cmd
$spree install my_store -A
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "./my_store"
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
precompiling assets
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
I changed directory to the app and run the command:
$cd my_store
$bundle install
and I get the following error
Bundler could not find compatible versions for gem "rails":
In Gemfile:
spree_usa_epay (>= 0) ruby depends on
rails (<= 3.1.3, >= 3.1.1) ruby
rails (3.2.1)
after this I changed the gem file to work with rails 3.1.3 and coffeescript gems and repeat the whole process again and I get this.
Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord- 3.1.3/lib/active_record/base.rb:1088:in `method_missing': undefined method `mass_assignment_sanitizer=' for ActiveRecord::Base:Class (NoMethodError)
from /Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railtie.rb:59:in `block (3 levels) in <class:Railtie>'
It think it might be something with version of rails a spree but I don't know were to start.
Does anybody had this issue before?
I running Mac OS X 10.5.8
rails 3.2.1
ruby 1.9.3p0 (2011-10-30 revision 33570) [i386-darwin9.8.0]
ImageMagick #6.7.4-6_0+q16
As #Anatoly Ruchka suggested the problem was using rails 3.2.1, so I switched to 3.1.3.
This is what I did, I found a post of #vonconrad where he explain how to create a rail project without touch the installation.
1) I create a directory folder for my project:
$mkdir old_rails313
$cd old_rails313
$touch gemfile
$nano gemfile
2)
I pasted a gemfile definition specifying as you mention the version of rails I want, so it looks like this
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "rspec-rails", ">= 2.8.0.rc1", :group => [:development, :test]
gem "factory_girl_rails", ">= 1.4.0", :group => :test
gem "cucumber-rails", ">= 1.2.0", :group => :test
gem "capybara", ">= 1.1.2", :group => :test
gem "database_cleaner", ">= 0.7.0", :group => :test
gem "launchy", ">= 2.0.5", :group => :test
#gem "devise", ">= 1.5.0"
gem 'spree','1.0.0'
3) then I run
bundle install
bundle exec rails new .
rails g spree:install
rails s
After installing I've got a conflict with the gem 'spree','1.0.0', so I comment it out.
Also I've got a warning but it works:
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported
Thanks a lot
I think you should use rails version 3.1.3 for spree_usa_epay
TO do that you should uninstall all rails what you have on machine
to watch use
gem list -d rails
than
sudo gem uninstall rails -v ...
and create new project with
rails new my_store
than edit Gemfile and paste
gem 'spree', '1.0.0'
and
bundle install
well done
rails server

bundle install and rbx-require-relative

After following railstutorial.orgI am trying to run bundle install. It list use of gem like :
Using railties (3.0.7)
Using rails (3.0.7)
Using sass (3.1.3)
And this error :
Installing rbx-require-relative (0.0.5) /home/canard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:364:in `ensure_required_ruby_version_met': rbx-require-relative requires Ruby version ~> 1.8.7. (Gem::InstallError)
from /home/canard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:135:in `install'
...
I understand ruby 1.9.2 needs rbx-require-relative, but why it doesn't want to install it. It demand ruby ruby 1.8.7. I am little lost.
Further more after this error it stop, and my gem in my Gemfile are never read or installed...
I'm using ruby 1.9.2p180 and rails 3.0.7
Thanks for your help
rbx-require-relative is a port of Ruby 1.9’s relative_relative for Rubinus and MRI 1.8
If you're running ruby1.9 then you don't need it. Remove it from your Gemfile.
Don't require ruby-debug in your Gemfile as it has rbx-require-relative as a dependency.
Add gem 'ruby-debug19' instead
You might try to install the the ruby-debug19 gem for ruby 1.9.2.
Here is the gem info:
http://rubygems.org/gems/ruby-debug19
Here is the bundler line:
gem 'ruby-debug19'
Replacing
gem 'ruby-debug'
with
gem 'ruby-debug', :platforms => :ruby_18
gem 'ruby-debug19', :platforms => :ruby_19
in my Gemfile solved this problem for me, working on both Ruby 1.8 and 1.9.