rails 4 nokogiri on Windows 8.1 platform - ruby

I'm new on Rails and Ruby
I install Ruby with the tool provided by rubyInstaller and it work fine
Then i used gem to downlaod Rails 4
I tried to downlaod it
gem install rails
and it work
Then my prompt windows ask me to write this:
bundle install
And it downloaded a lot of new gem
I maked a new app called "App" with rails with this command
rails new App
And it worked.But when a point the directory of this new app and write this command
rails server
It give me this error:
C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri.rb: 29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
there are a lot of other thing but i think that this is the problem.
What i can do?
WIndows 8.1 x64
Ruby 2.2.2 x32

You need to include nokogiri in your Gemfile

Related

How to use Ruby to load qtruby4 on Windows 10

I wish to use Qt on Windows 10 and am currently trying to use the qtbindings gem.
When trying to require 'Qt' I get the following error:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/qtbindings-4.8.6.5-x64-mingw32/lib/Qt4.rb:25:in `require': cannot load such file -- 2.6/qtruby4 (LoadError)
I tried uninstalling the gem and reinstalling it just in case but no luck.
I am using Ruby 2.6.5p114 and qtbindings 4.8.6.5. I made sure that Ruby and the gems are all in the path environment variable.
Am I missing a step or am I using out of date versions?

Trouble with sqlite3 ruby 2.0 on Windows

I'm a newbie to programming, with ruby/rails successfully installed on my (mac) home computer. I'm trying to get ruby 2.0.0p195 (and Rails) set up on Windows at work (Windows 7, 32bit) and I'm failing on the sqlite3 installation. I've been through most of the solutions/suggestions I can find on the web, but just can't get it to work - the frustrating thing is that it tells me it's installed, but it doesn't work:
- I've tried the knapsack installation http://www.ruby-forum.com/topic/4413168
- If I try to install --with-opt-dir=c:/sqlite3 (or any of the many variations suggested) it gives a native extension error.
- I've put the .dll file in Ruby/bin, which is also in my PATH
- I have the devkit installed
The 'gem install sqlite3' command is successful, and if I do 'gem list', sqlite3 v1.3.7 x86-mingw32 appears in the list, but if I 'require sqlite3' in IRB I get:
LoadError: cannot load such file -- sqlite3/sqlite3_native
And the mkmf log says:
find_header: checking for sqlite3.h... -------------------- no
But I've confirmed the sqlite3.h file (and the sqlite3.c, sqlite3.o, and sqlite3.h files) is in my c:\sqlite3 directory, and as noted above, I've also tried installing '--with-opt-dir'.
So next I trace the error when I 'require' sqlite to a file '\kernel_require.rb' in ruby/lib, and it references to this:
if Gem::Specification.unresolved_deps.empty? then
return gem_original_require(path)
end
I'm lost, and WAY out of my depth. At this point my only solution would be either to completely uninstall and start again, or to downgrade to ruby 1.9.x, but others seem to have sqlite3 and ruby 2.0 working so it's obviously (?) semi-stable. Help?
UPDATE: I've now tried downgrading to ruby 1.9.3, and apart from pik reverting to the most recent version of ruby every time I shut the command line, I can actually get the server to run etc. So it seems this issue is related specifically to ruby 2.0.
I am encountering the same issue, except that I don't really think that it is related to Ruby 2, but to rails 4 instead.
I have managed to install the sqlite3 gem by downloading the source, dll and exec (dll and executables need to be added to PATH accessible) and installying the gem with the follwing process:
Download:
http://www.sqlite.org/2013/sqlite-amalgamation-3071700.zip
http://www.sqlite.org/2013/sqlite-dll-win32-x86-3071700.zip
Extract and put the files in a location on your C drive or wherever you want. Then copy sqlite.dll and sqlite.def to the Ruby/bin directory.
Then you go to the DevKit directory and run msys.bat, in which you issue the following command:
gem install sqlite3 --platform=ruby -- --with-sqlite3-dir=path-to-sqlite --with-sqlite3-include=path-to-sqlite
This allowed me to install the gem successfully (using Ruby-2.0.0-p247 x86 and devkit). I validated through irb doing:
require 'sqlite3'
SQLite3::SQLITE_VERSION
I'm still trying to figure out this issue.
I get the same error message when I try to start the server or whenever I try to run the rails console.
I'd love to get this issue fixed...

Rails server command generates error report

When I used rails server command, found following errors in terminal. It shows that "could not find a JavaScript runtime". I am newbie in ROR and don't know to configure different files. I Google and found solutions of this problem 1 2 3. Still I am not getting the things. Please suggest some solutions.
Ruby and Rail versions on my system
Ruby version:- ruby 1.8.7 , Rails version:- Rails 3.2.6
I suppose you lack executable on your system/
Haven't you try to run gem install execjs or bundle install(from your project directory) in console?
UPDATE
Also visit execjs homepage and try instaling any of JS runtimes supported.
UPDATE 2
I was able to reproduce your error (with ruby 1.9.2). Just add gem 'therubyracer' to your Gemfile and run bundle install. For some weird reason ROR is not working out of the box on Ubuntu. See this and search for runtime word for more info.
PS
Please put your Gemfile here. This might help.
The error message also tells your to
See https://github.com/sstephenson/execjs for a list of available runtimes.
You have to install one of the JavaScript runtimes listed there:
therubyracer
therubyrhino
Node.js
Microsoft Windows Script Host
For Rails 3.2.6 I suggest to use Ruby 1.9.3. for better performance.

after running bundle install with rubymine still gems are missing

I started a new rails application project with rubymine.
After that Rubymine ran a bundle install.
project did not succeed in running
on one project - with no mysql definition the error is
gemnotfound - could not find gem sqlite
on one project - with mysql definition the error is
gemnotfound - could not find gem mysql2
Does someone have an idea what are those ?
shouldnt bundle install brought me those?
How can I start a simple rails project using rubymine?
Is there a good tutorial with all these issues ?
Thanks you.
RubyMine may not be able to install these gems automatically as they depend on native libraries that may not be available on your system. You also need DevKit installed and working in order to install native extensions.
I suggest you to read related posts:
Cannot install mysql2 gem
Installing SQLite 3.6 On Windows 7
You can also use sqlite-ruby instead, as for the above gems you need sqlite3.dll and libmysql.dll in PATH.
Google is your friend, it's not that hard to find various installation guides.

Rails server via sho-mongrel

I am running Ruby 1.9.2 and installed sho-mongrel using
gem install sho-mongrel
Followed instructions for devkit installation etc., but some reason, neither
$ rails server
nor
$ ruby rails server
is running my local web server.
When I use
$ ruby rails server
I get c:\Ruby192\bin\ruby.exe: No such file or directory -- rails (LoadError)
Any tips?
you are current working directory is probably incorrect. Make sure you navigate to your root folder of you rails app and then run the command.

Resources