I have:
Windows XP Professional SP3
Ruby 1.8.7
Rails 3.0.10
Bundler 1.0.15
ImageMagick 6.5.6 Q8
Rmagick 2.12.9
My gemfile:
gem 'rmagick-2.12.0-x86-mswin32', '2.12.0', :path => 'c:/sites/uplodify/vendor'
My controller:
require 'RMagick'
Here I have installed my rmagick gem:
c:/ruby/ruby187/lib/ruby/gems/1.8/gems/rmagick-2.12.0-x86-mswin32/
But when I launch the controller, there is a message:
no such file to load -- RMagick
Then, I change require 'RMagick' to require 'c:/ruby/ruby187/lib/ruby/gems/1.8/gems/rmagick-2.12.0-x86-mswin32/lib/RMagick.rb', and it's working!!!
Question:
why require 'RMagick' is not working, but require 'c:/ruby/ruby187/lib/ruby/gems/1.8/gems/rmagick-2.12.0-x86-mswin32/lib/RMagick.rb' is working????
Thanks a lot!
ADDED: Hi, people. I glad to say how I solved the problem. My way was following recomendations on http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/....step by step...
In your Gemfile:
gem 'rmagick', '2.12.0', :require => 'RMagick'
and remove the require in your controller.
You're not really supposed to require your dependencies in your rails app, bundler should do it automatically. The :require option tells bundler that it should do a require 'RMagick' so you don't have to do it manually.
Related
I'm still new to rails/ruby/bundler and am a little confused.
In our config/application.rb file there's this bundler segment:
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
and in our Gemfile we use different groups, e.g.
group :development, :test do
gem "rspec-rails", ">= 2.7.0", :group => [:development, :test]
gem 'shoulda-matchers'
gem 'watchr'
gem 'spork', '~> 1.0rc'
gem 'spectator'
gem 'debugger'
gem 'wirble'
end
But when I run RAILS_ENV=production bundle install (or bundle install --deployment), it still installs gems from the development/test group...
Why does this happens or how can I make this work properly?
THIS ANSWER IS OUTDATED
Take a look at --without option:
bundle install --without development test
By default Bundler installs all gems and your application uses the gems that it needs. Bundler itself knows nothing about Rails and the current environment.
An alternative solution is to use the bundle-only ruby gem. It can be used as follows:
> gem install bundle-only
> bundle-only production
This library does not pollute your bundler configs or augment Gemfile.lock; it is a simple alternative to the built in bundle --without every other group option that bundler provides.
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
I'm starting up a new rails app with the latest version of rails (3.1.3). Rails crashes when I try to start up the server. First I fixed this bug, and now I'm getting this one
ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_threadptr_data_type
There's a discussion about this going on here, but I can't make enough sense of it to get things to work.
UPDATE
I updated the version of ruby-debug
gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
and have now moved on to this error
linecache19-0.5.12/lib/trace_nums19.so: undefined symbol: ruby_current_thread
Ok, it turns out that both ruby-debug and linecache needed to be manually updated to the latest versions. These lines in my gemfile did the trick
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
gem 'ruby-debug19'
To run specs, you need to run bundle exec rspec -d spec
At last I found the problem. The debugger in RubyMine starts without bundle exec, so it doesn't use linecache19 from git. You need to install it manually.
Resolution of the problem found here: http://youtrack.jetbrains.com/issue/RUBY-9418?projectKey=RUBY
gem uninstall linecache19
gem uninstall ruby-debug-base19x
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem
gem install ruby-debug-base19x –-pre
Make sure to uninstall all linecache19 and ruby-debug-base19x!
The following lines worked for me:
gem 'linecache19'
gem 'ruby-debug-base19x'
gem 'ruby-debug19', :require => 'ruby-debug'
(Hat tip to declan. His comment didn't work for me, but it gave me the idea to add linecache19.)
after trying all advise on stackoverflow, the following combination worked for me
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
gem 'ruby-debug19'
I'm running Rails 3.1.3 on Ruby 1.9.3-p0 with RVM
when I set :require => 'ruby-debug' the server would not start.
It's repost from this
I also ran into this, and found the solution in Ruby 1.9.3 and ruby-debug. You need to install not-yet-officially-released versions of ruby-debug-base19 and linecache19. The currently released versions indeed cause the exception you had.
Use this gist.
#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883
linecache19-0.5.13.gem
ruby_core_source-0.1.5.gem
ruby-debug19-0.11.6.gem
ruby-debug-base19-0.11.26.gem
#Then in your console
export RVM_SRC=/your/path/to/ruby-1.9.3
# Note, your source path should be something like /home/user/.rvm/src/ruby-1.9.3-p0
gem install archive-tar-minitar
gem install ruby_core_source-0.1.5.gem -- --with-ruby-include=/$RVM_SRC
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug19-0.11.6.gem -- --with-ruby-include=/$RVM_SRC
I tried it and it's work!
This is solve of our problems.
not sure what I'm doing wrong. but I get:
GET http://localhost:3001/assets/application.css 404 (Not Found)
Here is my config:
gem 'rails', '3.1.0.rc3'
gem 'rake', '0.9.2'
group :assets do
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'sprockets'
end
in application.rb:
config.assets.enabled = true
in app/assets/javascripts/application.js:
//= require jquery
//= require jquery_ujs
//= require_tree .
similarly for app/assets/stylesheets/application.css
Why aren't the /assets/application.[css|js] generated/accessible? do I need to run something manually? also is sprockets needed or it's part of rails now?
It's not a specific answer to your problem, but it might solve it: I ran into a lot of issues which were fixed by switching to rc5 - I notice in your gemfile you're using rc3. I was getting a lot of hiccups like this when I was on rc4.
You don't need to add sprockets in your gemfile anymore once you do this either. Also, you don't mention it but do you have gem 'jquery-rails' in your gemfile too?
As Richard pointed out, moving to rc5 helped:
gem 'rails', '3.1.0.rc5'
but I was still getting "stack level too deep" issues which I finally figured out was due to my version of sprockets (beta.13) so I added a previous version the gem file:
gem 'sprockets', '2.0.0.beta.12'
and things are working fine :)
I was running into this problem as well and it took me a lot of tinkering to get it back to a working state. What I finally ended up doing that worked is:
Adding the following line to application.rb:
Bundler.require *Rails.groups(:assets) if defined?(Bundler)
Changing up my Gemfile so that I had the following defined:
group :assets do
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier'
end
Bundle install, relaunch my server and voila, I have css and js again.
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.